Ejemplo n.º 1
0
 public function removeCompteWithOps(Compte $compte)
 {
     $operationRepository = $this->_em->getRepository("MITFinanceBundle:Operation");
     $operationRepository->removeOperationByCompte($compte->getId());
     $this->_em->remove($compte);
     $this->_em->flush();
 }
Ejemplo n.º 2
0
 /**
  * @param Compte $compte
  * @return ArrayCollection
  */
 public function findOperationsByCompte(Compte $compte)
 {
     $qb = $this->_em->createQueryBuilder();
     $qb->select('op')->from('MITFinanceBundle:Operation', 'op')->join('op.compte', 'c')->where('c.id=' . $compte->getId());
     $query = $qb->getQuery()->getResult();
     return new ArrayCollection($query);
 }