/**
  * @param AgencyAccount $agency_account
  * @param bool $flush
  * @return AgencyAccount
  */
 public function remove(AgencyAccount $agency_account, $flush = true)
 {
     foreach ($this->accountOwnerManager->getByAccountAndAgency($agency_account->getAccount(), $agency_account->getAgency()) as $account_owner) {
         $this->accountOwnerManager->end($account_owner, false);
     }
     $this->em->remove($agency_account);
     if ($flush) {
         $this->em->flush();
     }
     return $agency_account;
 }
Exemple #2
0
 /**
  * Remove agencies
  *
  * @param \Enigmatic\CRMBundle\Entity\AgencyAccount $agencies
  */
 public function removeAgency(\Enigmatic\CRMBundle\Entity\AgencyAccount $agencies)
 {
     $this->agencies->removeElement($agencies);
 }