public function estDeCompetence(\TRC\CoreBundle\Entity\DDC\DDC $ddc, \TRC\CoreBundle\Entity\Fonction $fonction) { if (!is_null($fonction->getProfil()) && $fonction->getProfil()->getDdp()) { $tdc = $ddc->getTdc(); $Montant = $ddc->getCdcd()->getMontant(); $ddps = $this->em->getRepository('TRCCoreBundle:DDP')->findBy(array("fonction" => $fonction), array("id" => "desc"), null, 0); foreach ($ddps as $key => $ddp) { if ($ddp->concerneTdc($tdc) && $ddp->couvrirMontant($Montant)) { return true; } } } return false; }
/** * {@inheritDoc} */ public function getProfil() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getProfil', []); return parent::getProfil(); }