/** * @param TblBasket $tblBasket * * @return bool */ public function actionDestroyTempInvoice(TblBasket $tblBasket) { if ($tblBasket !== null) { $Manager = $this->Connection->getEntityManager(); /** @var TblTempInvoice[] $EntityList */ $EntityList = $Manager->getEntity('TblTempInvoice')->findBy(array(TblTempInvoice::ATTR_SERVICE_BILLING_BASKET => $tblBasket->getId())); foreach ($EntityList as $Entity) { $EntitySubList = $Manager->getEntity('TblTempInvoiceCommodity')->findBy(array(TblTempInvoiceCommodity::ATTR_TBL_TEMP_INVOICE => $Entity->getId())); foreach ($EntitySubList as $SubEntity) { Protocol::useService()->createDeleteEntry($this->Connection->getDatabase(), $SubEntity); $Manager->bulkKillEntity($SubEntity); } Protocol::useService()->createDeleteEntry($this->Connection->getDatabase(), $Entity); $Manager->bulkKillEntity($Entity); } $Manager->flushCache(); return true; } return false; }
/** * @param TblBasket $tblBasket * * @return bool */ public function actionDestroyBasketCommodity(TblBasket $tblBasket) { if ($tblBasket !== null) { $Manager = $this->Connection->getEntityManager(); /** @var TblBasketCommodity[] $EntityList */ $EntityList = $Manager->getEntity('TblBasketCommodity')->findBy(array(TblBasketCommodity::ATTR_TBL_BASKET => $tblBasket->getId())); foreach ($EntityList as $Entity) { $EntitySubList = $Manager->getEntity('TblBasketCommodityDebtor')->findBy(array(TblBasketCommodityDebtor::ATTR_TBL_BASKET_COMMODITY => $Entity->getId())); foreach ($EntitySubList as $SubEntity) { Protocol::useService()->createDeleteEntry($this->Connection->getDatabase(), $SubEntity); $Manager->bulkKillEntity($SubEntity); } Protocol::useService()->createDeleteEntry($this->Connection->getDatabase(), $Entity); $Manager->bulkKillEntity($Entity); } $Manager->flushCache(); return true; } return false; }
/** * @param TblBasket $tblBasket */ public function setServiceBillingBasket(TblBasket $tblBasket = null) { $this->serviceBilling_Basket = null === $tblBasket ? null : $tblBasket->getId(); }
/** * @param null|TblBasket $tblBasket */ public function setTblBasket($tblBasket = null) { $this->tblBasket = null === $tblBasket ? null : $tblBasket->getId(); }