Skip to content

Commit 8176d83

Browse files
committed
Remove abbreviation in var name $em
1 parent 2664394 commit 8176d83

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Resources/skeleton/crud/controller/Controller.tpl.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public function new(Request $request): Response
4646
$form->handleRequest($request);
4747

4848
if ($form->isSubmitted() && $form->isValid()) {
49-
$em = $this->getDoctrine()->getManager();
50-
$em->persist($<?= $entity_var_singular ?>);
51-
$em->flush();
49+
$entityManager = $this->getDoctrine()->getManager();
50+
$entityManager->persist($<?= $entity_var_singular ?>);
51+
$entityManager->flush();
5252

5353
return $this->redirectToRoute('<?= $route_name ?>_index');
5454
}
@@ -93,9 +93,9 @@ public function edit(Request $request, <?= $entity_class_name ?> $<?= $entity_va
9393
public function delete(Request $request, <?= $entity_class_name ?> $<?= $entity_var_singular ?>): Response
9494
{
9595
if ($this->isCsrfTokenValid('delete'.$<?= $entity_var_singular ?>->get<?= ucfirst($entity_identifier) ?>(), $request->request->get('_token'))) {
96-
$em = $this->getDoctrine()->getManager();
97-
$em->remove($<?= $entity_var_singular ?>);
98-
$em->flush();
96+
$entityManager = $this->getDoctrine()->getManager();
97+
$entityManager->remove($<?= $entity_var_singular ?>);
98+
$entityManager->flush();
9999
}
100100

101101
return $this->redirectToRoute('<?= $route_name ?>_index');

0 commit comments

Comments
 (0)