src/Entity/Menu.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. namespace App\Entity;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity
  9.  * @ORM\Table(name="menus")
  10.  */
  11. class Menu
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @ORM\Column(type="boolean")
  25.      */
  26.     private $isActive;
  27.     /**
  28.      * @ORM\OneToMany(targetEntity=MenuItem::class, mappedBy="menu", cascade={"persist", "remove"})
  29.      */
  30.     private $menuItems;
  31.     public function __construct()
  32.     {
  33.         $this->menuItems = new ArrayCollection();
  34.         $this->isActive true;
  35.     }
  36.     // Getters and setters...
  37. }