|
123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
-
- namespace Lc\ShopBundle\Controller\Backend;
-
-
- use Doctrine\ORM\EntityManagerInterface;
-
- use FOS\UserBundle\Model\UserManagerInterface;
- use Lc\ShopBundle\Services\UtilsManager;
- use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport;
- use Symfony\Component\Security\Core\Security;
- use Symfony\Contracts\Translation\TranslatorInterface;
- use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
-
- class ReductionCartController extends AdminController
- {
-
-
- public function updateReductionCartEntity($entity, $editForm = false)
- {
- $displayError =false;
- foreach ($entity->getCodes() as $code) {
- if ($reductionCart = $this->orderUtils->getReductionCartByCode($code)) {
- $this->addFlash('success', "Le code " . $code . " est déjà utilisé dans la réduction #" . $reductionCart->getId() . " " . $reductionCart->getTitle());
- $displayError = true;
- }
- }
- if ($displayError == false) parent::updateEntity($entity);
- }
-
- /* public function persistProductFamilyEntity($entity, $newForm)
- {
- $entity = $this->productFamilyUtils->processBeforePersistProductFamily($entity, $newForm);
-
- $this->em->persist($entity);
- $this->em->flush();
- }*/
- }
-
|