Пример #1
0
 public function initPhases(\TRC\CoreBundle\Entity\DDC\DDC $ddc)
 {
     $phases = $this->em->getRepository('TRCCoreBundle:DDC\\Phase')->findBy(array(), array("id" => "asc"), null, 0);
     foreach ($phases as $key => $phase) {
         # code...
         $pddc = new PDDC();
         $pddc->setDdc($ddc);
         $pddc->setPhase($phase);
         $this->em->persist($pddc);
         $etats = $this->em->getRepository('TRCCoreBundle:DDC\\Etat')->findBy(array("phase" => $phase), array("id" => "asc"), null, 0);
         foreach ($etats as $cle => $etat) {
             $eddc = new EDDC();
             $eddc->setPddc($pddc);
             $eddc->setEtat($etat);
             $eddc->setVerdict($etat->getDecision());
             $this->em->persist($eddc);
         }
     }
     $this->em->flush();
     return true;
 }
 /**
  * {@inheritDoc}
  */
 public function setEtat(\TRC\CoreBundle\Entity\DDC\Etat $etat)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setEtat', [$etat]);
     return parent::setEtat($etat);
 }