Skip to content

Instantly share code, notes, and snippets.

View acrnogor's full-sized avatar

Ante Crnogorac acrnogor

View GitHub Profile
@acrnogor
acrnogor / CreateAuthorCommand.php
Created February 27, 2020 12:05
Symfony Console questionaire :)
<?php
$firstName = $io->ask('Enter Author\'s first name');
$lastName = $io->ask('Enter Author\'s last name');
$gender = $io->ask('Enter Author\'s gender');
$birthday = $io->ask('Enter Author\'s birthday', '1940-12-23');
...
@acrnogor
acrnogor / kodovi
Created August 2, 2017 11:24
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']);
}