Last active
July 15, 2019 15:10
-
-
Save franzose/f501d521e76d35d655255da9fad0ecf3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MakeCoolStuff extends AbstractController | |
{ | |
public function __construct( | |
EntityManagerInterface $manager, | |
YourFunkyService $service | |
) { | |
$this->manager = $manager; | |
$this->service = $service; | |
} | |
public function __invoke(SomeEntityFormRequest $request, User $user): JsonResponse | |
{ | |
$vacancy = $this->service->createFromRequest($request, $user); | |
$this->manager->persist($vacancy); | |
$this->manager->flush(); | |
return new JsonResponse([ | |
'message' => 'Что-то там успешно создано!' | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment