<?php
namespace services\navigation;

/**
 * Menu class
 * Represents a menu hierarchy
 * @author Jérôme Brilland
 * @version 1.0
 * @copyright (c) 2023, Jérôme Brilland
 * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License
 */

class Menu {
    
    protected $root = null;

    /**
     * Constructor of class Menu.
     *
     * @return void
     */
    public function __construct() {
        $this->root = new MenuItem( 'root' );
    }

    public function addItem( MenuItem $item ) {
        $this->root->addChild( $item );
    }
    
    public function getItems() {
        return $this->root->getChildren();
    }

}
