Exemplo n.º 1
0
 /**
  * @param $name
  * @param Level|null $level
  * @return Level
  */
 public function addLevel($name, Level $level = null)
 {
     if ($level == null) {
         $level = new Level();
     }
     $this->levels[$name] = $level;
     $level->setParent($this);
     return $level;
 }
Exemplo n.º 2
0
 /**
  * @param Level $level
  * @return string
  */
 public function generateLevelName(Level $level)
 {
     return $this->parent->generateLevelName($this) . "[" . array_search($level, $this->levels, TRUE) . "]";
 }