src/CmsBundle/Entity/Bullet.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\CmsBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(
  6.  *     repositoryClass="App\CmsBundle\Repository\BulletRepository"
  7.  * )
  8.  *
  9.  * @ORM\Table(
  10.  *     name="bullet"
  11.  * )
  12.  */
  13. class Bullet
  14. {
  15.     use IdTrait;
  16.     /**
  17.      * @ORM\ManyToOne(targetEntity="App\CmsBundle\Entity\Route", inversedBy="bullet")
  18.      * @ORM\JoinColumn(name="route_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
  19.      */
  20.     private Route $route;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\CmsBundle\Entity\Page", inversedBy="bullet")
  23.      * @ORM\JoinColumn(name="page_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
  24.      */
  25.     private ?Page $page null;
  26.     /**
  27.      * @var ?string
  28.      * @ORM\Column(type="string", length=255, nullable=true)
  29.      */
  30.     private ?string $key null;
  31.     /**
  32.      * @var ?string
  33.      * @ORM\Column(type="string", length=255, nullable=true)
  34.      */
  35.     private ?string $value null;
  36.     /**
  37.      * @var ?string
  38.      * @ORM\Column(type="string", length=100, nullable=true)
  39.      */
  40.     private ?string $icon null;
  41.     /**
  42.      * @var ?string
  43.      * @ORM\Column(type="string", length=100, nullable=true)
  44.      */
  45.     private ?string $position null;
  46.     public function __toArray(): array
  47.     {
  48.         return [
  49.             'key' => $this->key,
  50.             'value' => $this->value,
  51.             'icon' => $this->icon,
  52.             'position' => $this->position
  53.         ];
  54.     }
  55.     /**
  56.      * @return Route
  57.      */
  58.     public function getRoute(): Route
  59.     {
  60.         return $this->route;
  61.     }
  62.     /**
  63.      * @param Route $route
  64.      * @return $this
  65.      */
  66.     public function setRoute(Route $route): self
  67.     {
  68.         $this->route $route;
  69.         return $this;
  70.     }
  71.     /**
  72.      * @return Page|null
  73.      */
  74.     public function getPage(): ?Page
  75.     {
  76.         return $this->page;
  77.     }
  78.     /**
  79.      * @param Page $page
  80.      * @return $this
  81.      */
  82.     public function setPage(Page $page): self
  83.     {
  84.         $this->page $page;
  85.         return $this;
  86.     }
  87.     /**
  88.      * @return string
  89.      */
  90.     public function getKey(): string
  91.     {
  92.         return $this->key;
  93.     }
  94.     /**
  95.      * @param string $key
  96.      * @return Bullet
  97.      */
  98.     public function setKey(string $key): self
  99.     {
  100.         $this->key $key;
  101.         return $this;
  102.     }
  103.     /**
  104.      * @return string
  105.      */
  106.     public function getValue(): string
  107.     {
  108.         return $this->value;
  109.     }
  110.     /**
  111.      * @param string $value
  112.      * @return Bullet
  113.      */
  114.     public function setValue(string $value): self
  115.     {
  116.         $this->value $value;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return int
  121.      */
  122.     public function getIcon(): int
  123.     {
  124.         return $this->icon;
  125.     }
  126.     /**
  127.      * @param int $icon
  128.      * @return Bullet
  129.      */
  130.     public function setIcon(int $icon): self
  131.     {
  132.         $this->icon $icon;
  133.         return $this;
  134.     }
  135.     /**
  136.      * @return ?string
  137.      */
  138.     public function getPosition(): ?string
  139.     {
  140.         return $this->position;
  141.     }
  142.     /**
  143.      * @param string $position
  144.      * @return Bullet
  145.      */
  146.     public function setPosition(string $position): self
  147.     {
  148.         $this->position $position;
  149.         return $this;
  150.     }
  151. }