/** * @param TblBasket $tblBasket * @param TblPerson $tblPerson * @param TblDebtor $tblDebtor * * @return TblTempInvoice|null */ public function actionCreateTempInvoice(TblBasket $tblBasket, TblPerson $tblPerson, TblDebtor $tblDebtor) { $Manager = $this->Connection->getEntityManager(); $Entity = $Manager->getEntity('TblTempInvoice')->findOneBy(array(TblTempInvoice::ATTR_SERVICE_BILLING_BASKET => $tblBasket->getId(), TblTempInvoice::ATTR_SERVICE_MANAGEMENT_PERSON => $tblPerson->getId(), TblTempInvoice::ATTR_SERVICE_BILLING_DEBTOR => $tblDebtor->getId())); if (null === $Entity) { $Entity = new TblTempInvoice(); $Entity->setServiceBillingBasket($tblBasket); $Entity->setServiceManagementPerson($tblPerson); $Entity->setServiceBillingDebtor($tblDebtor); $Manager->saveEntity($Entity); Protocol::useService()->createInsertEntry($this->Connection->getDatabase(), $Entity); } return $Entity; }
/** * @param TblPerson $tblPerson * * @return TblDebtor[]|bool */ public function entityDebtorAllByPerson(TblPerson $tblPerson) { $EntityList = $this->Connection->getEntityManager()->getEntity('TblDebtor')->findBy(array(TblDebtor::ATTR_SERVICE_MANAGEMENT_PERSON => $tblPerson->getId())); return null === $EntityList ? false : $EntityList; }
/** * @param null|TblPerson $ServiceManagementPerson */ public function setServiceManagementPerson(TblPerson $ServiceManagementPerson) { $this->ServiceManagementPerson = null === $ServiceManagementPerson ? null : $ServiceManagementPerson->getId(); //todo }
/** * @param TblPerson $tblPerson */ public function setServiceManagementPerson(TblPerson $tblPerson = null) { $this->serviceManagement_Person = null === $tblPerson ? null : $tblPerson->getId(); }
/** * @param TblBasket $tblBasket * @param TblPerson $tblPerson * * @return TblBasketPerson */ public function actionAddBasketPerson(TblBasket $tblBasket, TblPerson $tblPerson) { $Manager = $this->Connection->getEntityManager(); $Entity = $Manager->getEntity('TblBasketPerson')->findOneBy(array(TblBasketPerson::ATTR_TBL_Basket => $tblBasket->getId(), TblBasketPerson::ATTR_SERVICE_MANAGEMENT_PERSON => $tblPerson->getId())); if (null === $Entity) { $Entity = new TblBasketPerson(); $Entity->setTblBasket($tblBasket); $Entity->setServiceManagementPerson($tblPerson); $Manager->saveEntity($Entity); Protocol::useService()->createInsertEntry($this->Connection->getDatabase(), $Entity); } return $Entity; }