Exemplo n.º 1
0
 /**
  * @param string $Salutation
  * @param bool   $IsLocked
  *
  * @return TblSalutation
  */
 public function createSalutation($Salutation, $IsLocked = false)
 {
     $Manager = $this->Connection->getEntityManager();
     $Entity = $Manager->getEntity('TblSalutation')->findOneBy(array(TblSalutation::ATTR_SALUTATION => $Salutation));
     if (null === $Entity) {
         $Entity = new TblSalutation($Salutation);
         $Entity->setIsLocked($IsLocked);
         $Manager->saveEntity($Entity);
         Protocol::useService()->createInsertEntry($this->Connection->getDatabase(), $Entity);
     }
     return $Entity;
 }