This file contains 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