Example #1
0
 /**
  * @param string $Name
  *
  * @return TblType
  */
 public function createType($Name)
 {
     $Manager = $this->Connection->getEntityManager();
     $Entity = $Manager->getEntity('TblType')->findOneBy(array(TblType::ATTR_NAME => $Name));
     if (null === $Entity) {
         $Entity = new TblType();
         $Entity->setName($Name);
         $Manager->saveEntity($Entity);
         Protocol::useService()->createInsertEntry($this->Connection->getDatabase(), $Entity);
     }
     return $Entity;
 }