/** * @param null|TblType $tblType */ public function setTblType(TblType $tblType = null) { $this->tblType = null === $tblType ? null : $tblType->getId(); }
/** * @param TblCompany $tblCompany * @param TblPhone $tblPhone * @param TblType $tblType * @param string $Remark * * @return TblToCompany */ public function addPhoneToCompany(TblCompany $tblCompany, TblPhone $tblPhone, TblType $tblType, $Remark) { $Manager = $this->Connection->getEntityManager(); $Entity = $Manager->getEntity('TblToCompany')->findOneBy(array(TblToCompany::SERVICE_TBL_COMPANY => $tblCompany->getId(), TblToCompany::ATT_TBL_PHONE => $tblPhone->getId(), TblToCompany::ATT_TBL_TYPE => $tblType->getId())); if (null === $Entity) { $Entity = new TblToCompany(); $Entity->setServiceTblCompany($tblCompany); $Entity->setTblPhone($tblPhone); $Entity->setTblType($tblType); $Entity->setRemark($Remark); $Manager->saveEntity($Entity); Protocol::useService()->createInsertEntry($this->Connection->getDatabase(), $Entity); } return $Entity; }