<?php
namespace Engine\Menu\View;


abstract class ViewAbstract {

	/**
	 * The main menu object reference
	 * @var \App\Menu\Structure\Menu
	 */
	protected $menu;


	/**
	 * TODO This call should be moved to a different class
	 */
	public function initializeDefaults()
	{

		$menu = \App\Menu\Structure\CurrentUserMenu::getInstance();

		$this->setMenu($menu);

		return $this;
	}

	/**
	 * Set main menu
	 * @param \App\Menu\Structure\Menu $menu
	 * @return \Engine\Menu\View\ViewAbstract
	 */
	public function setMenu(\App\Menu\Structure\Menu $menu)
	{
		$this->menu = $menu;
		return $this;
	}

	/**
	 * Get main menu
	 * @return \App\Menu\Structure\Menu
	 */
	public function getMenu()
	{
		return $this->menu;
	}


	/**
	 * Render the menu
	 * @return string
	 */
	abstract public function render();


}
