<?php
namespace MLDev\BaseBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Menu
*
* @ORM\Table(name="MLDev_Menu")
* @ORM\Entity(repositoryClass="MLDev\BaseBundle\Repository\MenuRepository")
*/
class Menu
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="alias", type="string", length=255)
*/
private $alias;
/**
* @ORM\ManyToMany(targetEntity=Page::class, mappedBy="menu", fetch="EXTRA_LAZY")
*/
protected $pages;
/**
* Constructor
*/
public function __construct()
{
$this->pages = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
*
* @return Menu
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set alias
*
* @param string $alias
*
* @return Menu
*/
public function setAlias($alias)
{
$this->alias = $alias;
return $this;
}
/**
* Get alias
*
* @return string
*/
public function getAlias()
{
return $this->alias;
}
/**
* Add pages
*
* @param Page $pages
* @return Menu
*/
public function addPage(Page $pages)
{
$this->pages[] = $pages;
return $this;
}
/**
* Remove pages
*
* @param Page $pages
*/
public function removePage(Page $pages)
{
$this->pages->removeElement($pages);
}
/**
* Get pages
*
* @return \Doctrine\Common\Collections\ArrayCollection
*/
public function getPages()
{
return $this->pages;
}
}