Skip to content

Instantly share code, notes, and snippets.

@acrnogor
Created August 2, 2017 11:24
Show Gist options
  • Save acrnogor/f0f52f09cbb2a796496f8aa23a83ef72 to your computer and use it in GitHub Desktop.
Save acrnogor/f0f52f09cbb2a796496f8aa23a83ef72 to your computer and use it in GitHub Desktop.
neki kodovi
// neka klasa tamo
public function updateAction(Request $request, $id) : JsonResponse
{
$this->get('q_example.author.repository')->findOr404($id);
$author = $this->runJsonFactory($this->get('q_example.author.factory'), $request->getContent(), ['default']);
$author = $this->get('q_example.author.repository')->merge($author);
return $this->serializeToJsonResponse($author, ['default', 'books']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment