Exemplo n.º 1
0
 /**
  * @param string $Code
  * @param string $Name
  * @param string $District
  *
  * @return TblCity
  */
 public function createCity($Code, $Name, $District)
 {
     $Manager = $this->Connection->getEntityManager();
     $Entity = $Manager->getEntity('TblCity')->findOneBy(array(TblCity::ATTR_CODE => $Code, TblCity::ATTR_NAME => $Name));
     if (null === $Entity) {
         $Entity = new TblCity();
         $Entity->setCode($Code);
         $Entity->setName($Name);
         $Entity->setDistrict($District);
         $Manager->saveEntity($Entity);
         Protocol::useService()->createInsertEntry($this->Connection->getDatabase(), $Entity);
     }
     return $Entity;
 }