/**
  * @param null|TblSubject $tblSubject
  */
 public function setTblSubject(TblSubject $tblSubject = null)
 {
     $this->tblSubject = null === $tblSubject ? null : $tblSubject->getId();
 }
Exemplo n.º 2
0
 /**
  * @param TblCategory $tblCategory
  * @param TblSubject  $tblSubject
  *
  * @return bool
  */
 public function removeCategorySubject(TblCategory $tblCategory, TblSubject $tblSubject)
 {
     $Manager = $this->Connection->getEntityManager();
     /** @var TblCategorySubject $Entity */
     $Entity = $Manager->getEntity('TblCategorySubject')->findOneBy(array(TblCategorySubject::ATTR_TBL_CATEGORY => $tblCategory->getId(), TblCategorySubject::ATTR_TBL_SUBJECT => $tblSubject->getId()));
     if (null !== $Entity) {
         Protocol::useService()->createDeleteEntry($this->Connection->getDatabase(), $Entity);
         $Manager->killEntity($Entity);
         return true;
     }
     return false;
 }