patch() public method

Patch (partial in-place update) a resource
public patch ( mixed $id, mixed $data ) : ZF\ApiProblem\ApiProblem | mixed
$id mixed
$data mixed
return ZF\ApiProblem\ApiProblem | mixed
Example #1
0
 /**
  * Patch (partial in-place update) a resource
  *
  * @param  int  $noteId
  * @param  stdClass $data
  * @return ApiProblem|mixed
  */
 public function patch($noteId, $data)
 {
     if (empty($data->userId) || !is_numeric($data->userId)) {
         return new ApiProblem(422, 'userId value missing');
     }
     $this->setEntityIdentifierName('userId.noteId');
     return parent::patch($data->userId . '.' . $noteId, $data);
 }