From 58fa22658ae0044966b61b42e11ed1c7c376e980 Mon Sep 17 00:00:00 2001 From: Andi Nitsche Date: Tue, 2 Jan 2018 08:51:31 +0100 Subject: [PATCH] changed em to entityManager --- .../src/Admin/Controller/OrderController.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/module/Admin/src/Admin/Controller/OrderController.php b/module/Admin/src/Admin/Controller/OrderController.php index 02547ef8..434ce49b 100644 --- a/module/Admin/src/Admin/Controller/OrderController.php +++ b/module/Admin/src/Admin/Controller/OrderController.php @@ -449,7 +449,7 @@ public function sendEticketsAction() { ->findOneBy(array('id' => $orderId)); - $validStatus = $em->getRepository('ErsBase\Entity\Status') + $validStatus = $entityManager->getRepository('ErsBase\Entity\Status') ->findBy(array('valid' => 1)); $validArray = array_filter($validStatus, function($status) {return $status->getValid();}); @@ -1077,21 +1077,21 @@ public function changeStatusAction() { $entityManager = $this->getServiceLocator() ->get('Doctrine\ORM\EntityManager'); - $order = $em->getRepository('ErsBase\Entity\Order') + $order = $entityManager->getRepository('ErsBase\Entity\Order') ->findOneBy(array('id' => $id)); if(!$order) { throw new \Exception('Unable to find order with id '.$id); } - $form = new Form\SimpleForm($em); + $form = new Form\SimpleForm($entityManager); $form->get('submit')->setAttributes(array( 'value' => _('save'), 'class' => 'btn btn-success', )); - $status = $em->getRepository('ErsBase\Entity\Status') + $status = $entityManager->getRepository('ErsBase\Entity\Status') ->findBy(array(), array('position' => 'ASC')); $statusId = $order->getStatus()->getId(); @@ -1140,10 +1140,10 @@ public function changeStatusAction() { if ($form->isValid()) { $data = $form->getData(); - $status = $em->getRepository('ErsBase\Entity\Status') + $status = $entityManager->getRepository('ErsBase\Entity\Status') ->findOneBy(array('id' => $data['status_id'])); - $order = $em->getRepository('ErsBase\Entity\Order') + $order = $entityManager->getRepository('ErsBase\Entity\Order') ->findOneBy(array('id' => $data['order_id'])); $statusService = $this->getServiceLocator() @@ -1178,14 +1178,14 @@ public function changeCommentAction() { $entityManager = $this->getServiceLocator() ->get('Doctrine\ORM\EntityManager'); - $order = $em->getRepository('ErsBase\Entity\Order') + $order = $entityManager->getRepository('ErsBase\Entity\Order') ->findOneBy(array('id' => $id)); if(!$order) { throw new \Exception('Unable to find order with id '.$id); } - $form = new Form\SimpleForm($em); + $form = new Form\SimpleForm($entityManager); $form->get('submit')->setAttributes(array( 'value' => _('save'), @@ -1224,13 +1224,13 @@ public function changeCommentAction() { if ($form->isValid()) { $data = $form->getData(); - $order = $em->getRepository('ErsBase\Entity\Order') + $order = $entityManager->getRepository('ErsBase\Entity\Order') ->findOneBy(array('id' => $data['order_id'])); $order->setComment($data['comment']); - $em->persist($order); - $em->flush(); + $entityManager->persist($order); + $eneityManager->flush(); $this->flashMessenger()->addSuccessMessage('Comment for for order '.$order->getCode()->getValue().' has been saved.'); return $this->redirect()->toRoute('admin/order', array(