been playing with Apigility a bit and there is something i do not like. My delete method in an entity mapper looks like:
public function delete($id)
{
$affectedRows = $this->table->delete(
array('userId' => $id)
);
if (0 === $affectedRows) {
throw new DomainException('ID not found', 500);
}
return $affectedRows;
}
And in the matching entity resources i've got:
public function delete($id)
{
$affectedRows = $this->mapper->delete($id);
return new ApiProblem(200, 'Affected rows count ' . $affectedRows);
}
but i think it is not appropiate to call ApiProblem for a 200 code. Is there anything that suits for a success operation?