Ejemplo n.º 1
0
 /** @ORM\PostUpdate */
 public function postUpdate(Iban $iban, LifecycleEventArgs $event)
 {
     $entity = $event->getEntity();
     $entityManager = $event->getEntityManager();
     $cacheDriver = $entityManager->getConfiguration()->getResultCacheImpl();
     $cacheDriver->delete('getIban_' . $iban->getPhotographer()->getId());
 }
Ejemplo n.º 2
0
 /**
  * [addPrice description]
  * @param Devis  $devis    [description]
  * @param [type] $duration [description]
  * @param [type] $price    [description]
  */
 public function create($comment, $price, Iban $iban, Prestation $prestation)
 {
     $transaction = new Transaction();
     $transaction->setPhotographer($prestation->getDevis()->getCompany()->getPhotographer());
     $transaction->setPrestation($prestation);
     $transaction->setPrice($price);
     $transaction->setIban($iban->getIban());
     $transaction->setComment($comment);
     try {
         $this->em->persist($transaction);
         $this->em->flush();
         $this->service->closePrestation($prestation);
         $this->session->successFlashMessage('flash.message.transaction.create');
         return true;
     } catch (\Exception $e) {
         $this->session->errorFlashMessage();
         $this->logger->error($e->getMessage());
         return false;
     }
 }
Ejemplo n.º 3
0
 /**
  * 
  * @param Iban $iban
  */
 public function update(Iban $Iban, $data)
 {
     $Iban->setName($data['name']);
     $Iban->setAddress($data['address']);
     $Iban->setIban($data['iban']);
     $Iban->setBic($data['bic']);
     $Iban->setUpdatedAt(new \DateTime('now'));
     try {
         $this->em->flush();
         $this->session->successFlashMessage('flash.message.iban.edit');
         return true;
     } catch (\Exception $e) {
         $this->session->errorFlashMessage();
         $this->logger->error($e->getMessage());
         return false;
     }
 }