Пример #1
0
 /**
  * @param TblAccount $tblAccount
  *
  * @return bool
  */
 public function destroyAccount(TblAccount $tblAccount)
 {
     $Manager = $this->Connection->getEntityManager();
     /** @var TblAccount $Entity */
     $Entity = $Manager->getEntityById('TblAccount', $tblAccount->getId());
     if (null !== $Entity) {
         Protocol::useService()->createDeleteEntry($this->Connection->getDatabase(), $Entity);
         $Manager->killEntity($Entity);
         return true;
     }
     return false;
 }
Пример #2
0
 /**
  * @param null|TblAccount $tblAccount
  */
 public function setServiceTblAccount(TblAccount $tblAccount = null)
 {
     $this->serviceTblAccount = null === $tblAccount ? null : $tblAccount->getId();
 }
Пример #3
0
 /**
  * @param TblAccount $tblAccount
  * @param TblPerson  $tblPerson
  *
  * @return bool
  */
 public function removeAccountPerson(TblAccount $tblAccount, TblPerson $tblPerson)
 {
     $Manager = $this->Connection->getEntityManager();
     /** @var TblUser $Entity */
     $Entity = $Manager->getEntity('TblUser')->findOneBy(array(TblUser::ATTR_TBL_ACCOUNT => $tblAccount->getId(), TblUser::SERVICE_TBL_PERSON => $tblPerson->getId()));
     if (null !== $Entity) {
         Protocol::useService()->createDeleteEntry($this->Connection->getDatabase(), $Entity);
         $Manager->killEntity($Entity);
         return true;
     }
     return false;
 }