Esempio n. 1
0
 /**
  * @param TblAccount     $tblAccount
  * @param                $Description
  * @param                $Number
  * @param                $IsActive
  * @param TblAccountKey  $tblAccountKey
  * @param TblAccountType $tblAccountType
  *
  * @return bool
  */
 public function actionEditAccount(TblAccount $tblAccount, $Description, $Number, $IsActive, TblAccountKey $tblAccountKey, TblAccountType $tblAccountType)
 {
     $Manager = $this->Connection->getEntityManager();
     /** @var TblAccount $Entity */
     $Entity = $Manager->getEntityById('TblAccount', $tblAccount->getId());
     $Protocol = clone $Entity;
     if (null !== $Entity) {
         $Entity->setDescription($Description);
         $Entity->setNumber($Number);
         $Entity->setIsActive($IsActive);
         $Entity->setTblAccountKey($tblAccountKey);
         $Entity->setTblAccountType($tblAccountType);
         $Manager->saveEntity($Entity);
         Protocol::useService()->createUpdateEntry($this->Connection->getDatabase(), $Protocol, $Entity);
         return true;
     }
     return false;
 }
 /**
  * @param TblAccount $serviceBilling_Account
  */
 public function setTblAccount(TblAccount $serviceBilling_Account = null)
 {
     $this->serviceBilling_Account = null === $serviceBilling_Account ? null : $serviceBilling_Account->getId();
 }
Esempio n. 3
0
 /**
  * @param TblItem    $tblItem
  * @param TblAccount $tblAccount
  *
  * @return TblItemAccount|null
  */
 public function actionAddItemAccount(TblItem $tblItem, TblAccount $tblAccount)
 {
     $Manager = $this->Connection->getEntityManager();
     $Entity = $Manager->getEntity('TblItemAccount')->findOneBy(array(TblItemAccount::ATTR_TBL_Item => $tblItem->getId(), TblItemAccount::ATTR_SERVICE_BILLING_ACCOUNT => $tblAccount->getId()));
     if (null === $Entity) {
         $Entity = new TblItemAccount();
         $Entity->setTblItem($tblItem);
         $Entity->setTblAccount($tblAccount);
         $Manager->saveEntity($Entity);
         Protocol::useService()->createInsertEntry($this->Connection->getDatabase(), $Entity);
     }
     return $Entity;
 }