コード例 #1
0
 /**
  * Création des lignes de jeux de données.
  *
  * @param EiDataSet $ds
  * @param null $parent
  */
 public function createEmptyDataLines($ds = null, $parent = null)
 {
     $line = new EiDataLine();
     $line->setEiDataSet($ds);
     $line->setLft($this->getLft());
     $line->setRgt($this->getRgt());
     $line->setLevel($this->getLevel());
     $line->setEiDataLineParent($parent);
     if ($parent == null) {
         $ds->setRootStr($line);
     }
 }
コード例 #2
0
 /**
  * @return EiDataLine
  */
 public function createRootDataLine()
 {
     $root_data_line = new EiDataLine();
     $root_data_line->setEiDataSetStructure($this->root_str);
     $root_data_line->setLft(1);
     $root_data_line->setRgt(2);
     $root_data_line->setLevel(0);
     $root_data_line->setEiDataSet($this);
     $root_data_line->save();
     $root_data_line->setRootId($root_data_line->getId());
     $root_data_line->save();
     return $root_data_line;
 }
コード例 #3
0
 /**
  * // TODO: Corriger, ne fonctionne pas très bien.
  * Création des lignes de jeux de données.
  *
  * @param null $ds
  * @param null $parent
  * @param bool $depth
  */
 public function createEmptyDataLines($ds = null, $parent = null, $depth = true)
 {
     $line = new EiDataLine();
     $line->setEiDataSet($ds);
     $line->setLft($this->getLft());
     $line->setRgt($this->getRgt());
     $line->setLevel($this->getLevel());
     $line->setEiDataLineParent($parent);
     $line->setEiDataSetStructureId($this->getId());
     if ($parent == null && $depth == false) {
         $line->setLft(1);
         $line->setRgt(2);
         $ds->setRootStr($line);
     } elseif ($parent == null) {
         $ds->setRootStr($line);
         foreach ($this->getNode()->getDescendants(1) as $node) {
             $node->createEmptyDataLines($ds, $line);
         }
     }
 }