/** * @param string|null $modelClass */ function __construct($modelClass = null) { $this->di = DI::getDefault(); $this->modelClass = $modelClass; if (is_null(static::$current)) { static::$current = $this; $this->level(0); } else { static::$current->addItem($this); $this->level(static::$current->level() + 1); } }
/** * @return MenuItem[] */ public function getMenu() { return $this->menu->items(); }