예제 #1
0
 /**
  * @param TblBalance $tblBalance
  * @param            $Value
  * @param \DateTime  $Date
  *
  * @return TblPayment|null|object
  */
 public function actionCreatePayment(TblBalance $tblBalance, $Value, \DateTime $Date)
 {
     $Manager = $this->Connection->getEntityManager();
     $Entity = $Manager->getEntity('TblPayment')->findOneBy(array('tblBalance' => $tblBalance->getId(), 'Value' => $Value, 'Date' => $Date));
     if (null === $Entity) {
         $Entity = new TblPayment();
         $Entity->setTblBalance($tblBalance);
         $Entity->setValue($Value);
         $Entity->setDate($Date);
         $Manager->saveEntity($Entity);
         Protocol::useService()->createInsertEntry($this->Connection->getDatabase(), $Entity);
     }
     return $Entity;
 }
예제 #2
0
 /**
  * @param null|TblBalance $tblBalance
  */
 public function setTblBalance($tblBalance = null)
 {
     $this->tblBalance = null === $tblBalance ? null : $tblBalance->getId();
 }