/**
  * @param LigneInterface $ligne
  * @return VentilationLigne
  */
 static function create(LigneInterface $ligne)
 {
     $ventilationLigne = new VentilationLigne();
     $ventilationLigne->setMontant($ligne->getMontant());
     $factory = new SectionFactory();
     $ventilationLigne->setSection($factory->create($ligne));
     return $ventilationLigne;
 }
Beispiel #2
0
 /**
  * @param LigneInterface $ligne
  * @return bool
  */
 public function addLigne(LigneInterface $ligne)
 {
     $ventilationLigne = VentilationLigneFactory::create($ligne);
     $factory = new SectionFactory();
     $section = $factory->create($ligne);
     if (!array_key_exists($section->getId(), $this->lignes)) {
         $ligneParent = clone $ventilationLigne;
         $ligneParent->setMontant(0);
         $this->lignes[$section->getId()] = $ligneParent;
     }
     $this->lignes[$section->getId()]->addLigne($ventilationLigne);
     return true;
 }