Esempio n. 1
0
 /**
  * @param TblBasketCommodity $tblBasketCommodity
  * @param TblDebtor          $tblDebtor
  *
  * @return TblBasketCommodityDebtor|null
  */
 public function actionCreateBasketCommodityDebtor(TblBasketCommodity $tblBasketCommodity, TblDebtor $tblDebtor)
 {
     $Manager = $this->Connection->getEntityManager();
     $Entity = $Manager->getEntity('TblBasketCommodityDebtor')->findOneBy(array(TblBasketCommodityDebtor::ATTR_TBL_BASKET_COMMODITY => $tblBasketCommodity->getId(), TblBasketCommodityDebtor::ATTR_SERVICE_BILLING_DEBTOR => $tblDebtor->getId()));
     if (null === $Entity) {
         $Entity = new TblBasketCommodityDebtor();
         $Entity->setTblBasketCommodity($tblBasketCommodity);
         $Entity->setServiceBillingDebtor($tblDebtor);
         $Manager->saveEntity($Entity);
         Protocol::useService()->createInsertEntry($this->Connection->getDatabase(), $Entity);
     }
     return $Entity;
 }
 /**
  * @param TblBasketCommodity $tblBasketCommodity
  */
 public function setTblBasketCommodity(TblBasketCommodity $tblBasketCommodity = null)
 {
     $this->tblBasketCommodity = null === $tblBasketCommodity ? null : $tblBasketCommodity->getId();
 }