Пример #1
0
 /**
  * @param $Name
  * @param $Description
  *
  * @return null|object|TblType
  */
 public function createType($Name, $Description = '')
 {
     $Manager = $this->Connection->getEntityManager();
     $Entity = $Manager->getEntity('TblType')->findOneBy(array(TblType::ATTR_NAME => $Name));
     if (null === $Entity) {
         $Entity = new TblType();
         $Entity->setName($Name);
         $Entity->setDescription($Description);
         $Manager->saveEntity($Entity);
         Protocol::useService()->createInsertEntry($this->Connection->getDatabase(), $Entity);
     }
     return $Entity;
 }
 /**
  * @param TblType|null $tblType
  */
 public function setServiceTblType(TblType $tblType = null)
 {
     $this->serviceTblType = null === $tblType ? null : $tblType->getId();
 }