src/Uniski/CMSBundle/Entity/Menu.php line 11

Open in your IDE?
  1. <?php
  2. namespace Uniski\CMSBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Entity
  6. * @ORM\Table("menu")
  7. */
  8. class Menu
  9. {
  10.   /**
  11.    * @var integer
  12.    *
  13.    * @ORM\Id
  14.    * @ORM\Column(name="id", type="integer")
  15.    * @ORM\GeneratedValue(strategy="IDENTITY")
  16.    */
  17.   protected $id;
  18.   /**
  19.    * @var   string
  20.    * @ORM\Column(name="title", type="string")
  21.    */
  22.   protected $title;
  23.   /**
  24.    * @var  ArrayCollection
  25.    * @ORM\OneToMany(targetEntity="Offer", mappedBy="menu")
  26.    */
  27.   protected $offers;
  28.     /**
  29.      * Get id
  30.      *
  31.      * @return integer
  32.      */
  33.     public function getId()
  34.     {
  35.         return $this->id;
  36.     }
  37.     /**
  38.      * Set title
  39.      *
  40.      * @param string $title
  41.      *
  42.      * @return Post
  43.      */
  44.     public function setTitle($title)
  45.     {
  46.         $this->title $title;
  47.         return $this;
  48.     }
  49.     /**
  50.      * Get title
  51.      *
  52.      * @return string
  53.      */
  54.     public function getTitle()
  55.     {
  56.         return $this->title;
  57.     }
  58.     /**
  59.      * Constructor
  60.      */
  61.     public function __construct()
  62.     {
  63.         $this->offers = new \Doctrine\Common\Collections\ArrayCollection();
  64.     }
  65.     /**
  66.      * Add offer
  67.      *
  68.      * @param \Uniski\CMSBundle\Entity\Offer $offer
  69.      *
  70.      * @return Page
  71.      */
  72.     public function addOffer(\Uniski\CMSBundle\Entity\Offer $offer)
  73.     {
  74.         $this->offers[] = $offer;
  75.         return $this;
  76.     }
  77.     /**
  78.      * Remove offer
  79.      *
  80.      * @param \Uniski\CMSBundle\Entity\Offer $offer
  81.      */
  82.     public function removeOffer(\Uniski\CMSBundle\Entity\Offer $offer)
  83.     {
  84.         $this->offers->removeElement($offer);
  85.     }
  86.     /**
  87.      * Get offers
  88.      *
  89.      * @return \Doctrine\Common\Collections\Collection
  90.      */
  91.     public function getOffers()
  92.     {
  93.         return $this->offers;
  94.     }
  95. }