Пример #1
0
 /** @ORM\PostUpdate */
 public function PostUpdate(DevisPrices $price, LifecycleEventArgs $event)
 {
     $entity = $event->getEntity();
     $entityManager = $event->getEntityManager();
     $cacheDriver = $entityManager->getConfiguration()->getResultCacheImpl();
     $cacheDriver->delete('getPricesByDuration_' . $price->getDevis()->getId());
     $cacheDriver->delete('getPricespublic_' . $price->getDevis()->getId());
 }
Пример #2
0
 /**
  * [editPrice description]
  * @param  DevisPrices $price [description]
  * @param  [type]      $new   [description]
  * @return [type]             [description]
  */
 public function editPrice(DevisPrices $price, $new)
 {
     $price->setPrice((double) $new);
     $price->setUpdatedAt(new \DateTime('now'));
     try {
         $this->em->flush();
         $this->session->successFlashMessage('flash.message.devis.price.edit');
         return true;
     } catch (\Exception $e) {
         $this->session->errorFlashMessage();
         $this->logger->error($e->getMessage());
         return false;
     }
 }