Example #1
0
 /**
  * @param $Name
  *
  * @return TblCommodityType
  */
 public function actionCreateCommodityType($Name)
 {
     $Manager = $this->Connection->getEntityManager();
     $Entity = $Manager->getEntity('TblCommodityType')->findOneBy(array('Name' => $Name));
     if (null === $Entity) {
         $Entity = new TblCommodityType();
         $Entity->setName($Name);
         $Manager->saveEntity($Entity);
         Protocol::useService()->createInsertEntry($this->Connection->getDatabase(), $Entity);
     }
     return $Entity;
 }
 /**
  * @param null|TblCommodityType $tblCommodityType
  */
 public function setTblCommodityType(TblCommodityType $tblCommodityType = null)
 {
     $this->tblCommodityType = null === $tblCommodityType ? null : $tblCommodityType->getId();
 }