Example #1
0
 /**
  * {@inheritdoc}
  */
 public function save($entity, $andFlush = true)
 {
     foreach ($entity->getBasketElements() as $element) {
         $element->setBasket($entity);
     }
     parent::save($entity, $andFlush);
 }
Example #2
0
 /**
  * {@inheritDoc}
  */
 public function save($message, $andFlush = true)
 {
     //Hack for ConsumerHandlerCommand->optimize()
     if ($message->getId() && !$this->om->getUnitOfWork()->isInIdentityMap($message)) {
         $this->getEntityManager()->getUnitOfWork()->merge($message);
     }
     parent::save($message, $andFlush);
 }
Example #3
0
 /**
  * @param string                  $class
  * @param ManagerRegistry         $registry
  */
 public function __construct($class, ManagerRegistry $registry, SecurityContext $securityContext)
 {
     parent::__construct($class, $registry);
     $this->user = $securityContext->getToken()->getUser();
     if ($this->user) {
         $this->userId = $this->user->getId();
     } else {
         $this->userId = 0;
     }
     $this->categories = array();
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function delete($address, $andFlush = true)
 {
     if ($address->getCurrent()) {
         $custAddresses = $address->getCustomer()->getAddressesByType(AddressInterface::TYPE_DELIVERY);
         if (count($custAddresses) > 1) {
             foreach ($custAddresses as $currentAddress) {
                 if ($currentAddress->getId() !== $address->getId()) {
                     $currentAddress->setCurrent(true);
                     $this->save($currentAddress);
                     break;
                 }
             }
         }
     }
     parent::delete($address, $andFlush);
 }
 /**
  * {@inheritdoc}
  */
 public function save($media, $andFlush = true)
 {
     /*
      * Warning: previous method signature was : save(MediaInterface $media, $context = null, $providerName = null)
      */
     // BC compatibility for $context parameter
     if ($andFlush && is_string($andFlush)) {
         $media->setContext($andFlush);
     }
     // BC compatibility for $providerName parameter
     if (3 == func_num_args()) {
         $media->setProviderName(func_get_arg(2));
     }
     if ($andFlush && is_bool($andFlush)) {
         parent::save($media, $andFlush);
     } else {
         // BC compatibility with previous signature
         parent::save($media, true);
     }
 }
Example #6
0
 /**
  *
  * @access public
  * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface       $dispatcher
  * @param \Bruery\UserSecurityBundle\Model\Component\Gateway\GatewayInterface $gateway
  */
 public function __construct($class, ManagerRegistry $registry, EventDispatcherInterface $dispatcher, GatewayInterface $gateway)
 {
     parent::__construct($class, $registry);
     $this->dispatcher = $dispatcher;
     $this->gateway = $gateway;
 }
 /**
  * {@inheritdoc}
  */
 public function save($page, $andFlush = true)
 {
     if (!$page->isHybrid()) {
         $this->fixUrl($page);
     }
     parent::save($page, $andFlush);
     return $page;
 }
Example #8
0
 /**
  * {@inheritdoc}
  */
 public function save($order, $andFlush = true)
 {
     $this->getEntityManager()->persist($order->getCustomer());
     parent::save($order, $andFlush);
 }
 /**
  * @param string                  $class
  * @param ManagerRegistry         $registry
  * @param ContextManagerInterface $contextManager
  */
 public function __construct($class, ManagerRegistry $registry, ContextManagerInterface $contextManager)
 {
     parent::__construct($class, $registry);
     $this->contextManager = $contextManager;
     $this->categories = array();
 }
Example #10
0
 /**
  * {@inheritdoc}
  */
 public function save($page, $andFlush = true)
 {
     parent::save($page, $andFlush);
     return $page;
 }
 /**
  * UserManagerProxy constructor.
  *
  * @param string          $class
  * @param ManagerRegistry $registry
  * @param UserManager     $userManager
  */
 public function __construct($class, ManagerRegistry $registry, UserManager $userManager)
 {
     parent::__construct($class, $registry);
     $this->userManager = $userManager;
 }
 /**
  * {@inheritdoc}
  */
 public function save($site, $andFlush = true)
 {
     parent::save($site, $andFlush);
     return $site;
 }
Example #13
0
 /**
  * {@inheritdoc}
  */
 public function save($snapshot, $andFlush = true)
 {
     parent::save($snapshot);
     return $snapshot;
 }
Example #14
0
 /**
  * BC Compatibility.
  *
  * @deprecated Please use save() from now
  *
  * @param GalleryInterface $gallery
  */
 public function update(GalleryInterface $gallery)
 {
     parent::save($gallery);
 }
 /**
  * {@inheritdoc}
  */
 public function save($dashboard, $andFlush = true)
 {
     parent::save($dashboard, $andFlush);
     return $dashboard;
 }
Example #16
0
 /**
  * {@inheritDoc}
  */
 public function delete($comment, $andFlush = true)
 {
     $post = $comment->getPost();
     parent::delete($comment, $andFlush);
     $this->updateCommentsCount($post);
 }
Example #17
0
 /**
  * {@inheritdoc}
  */
 public function save($block, $andFlush = true)
 {
     parent::save($block, $andFlush);
     return $block;
 }
 /**
  * @param string                  $class
  * @param ManagerRegistry         $registry
  */
 public function __construct($class, ManagerRegistry $registry)
 {
     parent::__construct($class, $registry);
     $this->categories = array();
 }