Exemple #1
0
 /**
  * @param TblTempInvoice $tblTempInvoice
  * @param TblCommodity   $tblCommodity
  *
  * @return TblTempInvoiceCommodity|null
  */
 public function actionCreateTempInvoiceCommodity(TblTempInvoice $tblTempInvoice, TblCommodity $tblCommodity)
 {
     $Manager = $this->Connection->getEntityManager();
     $Entity = $Manager->getEntity('TblTempInvoiceCommodity')->findOneBy(array(TblTempInvoiceCommodity::ATTR_TBL_TEMP_INVOICE => $tblTempInvoice->getId(), TblTempInvoiceCommodity::ATTR_SERVICE_BILLING_COMMODITY => $tblCommodity->getId()));
     if (null === $Entity) {
         $Entity = new TblTempInvoiceCommodity();
         $Entity->setTblTempInvoice($tblTempInvoice);
         $Entity->setServiceBillingCommodity($tblCommodity);
         $Manager->saveEntity($Entity);
         Protocol::useService()->createInsertEntry($this->Connection->getDatabase(), $Entity);
     }
     return $Entity;
 }
 /**
  * @param TblTempInvoice $tblTempInvoice
  */
 public function setTblTempInvoice(TblTempInvoice $tblTempInvoice = null)
 {
     $this->tblTempInvoice = null === $tblTempInvoice ? null : $tblTempInvoice->getId();
 }