src/Entity/Menu/WebsiteItems.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Menu;
  3. use Doctrine\DBAL\Types\Types;
  4. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * Website Items
  9.  *
  10.  * @ORM\Table("menu_website_items")
  11.  * @ORM\Entity(repositoryClass="App\Repository\Menu\WebsiteItemsRepository")
  12.  * @ORM\HasLifecycleCallbacks()
  13.  */
  14. class WebsiteItems
  15. {
  16.     /**
  17.      * @var integer
  18.      *
  19.      * @ORM\Column(name="id", type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     protected $id;
  24.     /**
  25.      * @var string
  26.      *
  27.      * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"})
  28.      */
  29.     private $createdAt;
  30.     /**
  31.      * @var string
  32.      *
  33.      * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"})
  34.      */
  35.     private $updatedAt;
  36.     /**
  37.      * @var string $title
  38.      *
  39.      * @ORM\Column(name="title", type="string", length=255, nullable=true)
  40.      */
  41.     private $title;
  42.     /**
  43.      * @var string $link
  44.      *
  45.      * @ORM\Column(name="link", type="string", length=255, nullable=true)
  46.      */
  47.     private $link;
  48.     /**
  49.      * @var string $sequence
  50.      *
  51.      * @ORM\Column(name="sequence", type="integer", length=11, nullable=true)
  52.      */
  53.     protected $sequence;
  54.     /**
  55.      * @var string
  56.      *
  57.      * @ORM\Column(name="type", type="string", length=255, nullable=true)
  58.      */
  59.     private $type;
  60.     /**
  61.      * @var \Parents
  62.      *
  63.      * @ORM\ManyToOne(targetEntity="WebsiteParents")
  64.      * @ORM\JoinColumns({
  65.      *   @ORM\JoinColumn(name="parent_id", referencedColumnName="id", nullable=true)
  66.      * })
  67.      */
  68.     protected $parent;
  69.     /**
  70.      * @var string $title
  71.      *
  72.      * @ORM\Column(name="description", type="text", nullable=true)
  73.      */
  74.     private $description;
  75.     /**
  76.      * @var string $link
  77.      *
  78.      * @ORM\Column(name="linkPicture", type="text", nullable=true)
  79.      */
  80.     private $linkPicture;
  81.     /**
  82.      * @ORM\PrePersist
  83.      */
  84.     public function setCreatedAtValue(): void
  85.     {
  86.         $this->setCreatedAt(new \DateTime("now"));
  87.         $this->setUpdatedAt(new \DateTime("now"));
  88.     }
  89.     /**
  90.      * @ORM\PreUpdate
  91.      */
  92.     public function setUpdatedAtValue(): void
  93.     {
  94.         $this->setUpdatedAt(new \DateTime("now"));
  95.     }
  96.     public function __toString()
  97.     {
  98.         return $this->title;
  99.     }
  100.     public function getId(): ?int
  101.     {
  102.         return $this->id;
  103.     }
  104.     public function getCreatedAt(): ?\DateTimeInterface
  105.     {
  106.         return $this->createdAt;
  107.     }
  108.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  109.     {
  110.         $this->createdAt $createdAt;
  111.         return $this;
  112.     }
  113.     public function getUpdatedAt(): ?\DateTimeInterface
  114.     {
  115.         return $this->updatedAt;
  116.     }
  117.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  118.     {
  119.         $this->updatedAt $updatedAt;
  120.         return $this;
  121.     }
  122.     public function getTitle(): ?string
  123.     {
  124.         return $this->title;
  125.     }
  126.     public function setTitle(?string $title): self
  127.     {
  128.         $this->title $title;
  129.         return $this;
  130.     }
  131.     public function getLink(): ?string
  132.     {
  133.         return $this->link;
  134.     }
  135.     public function setLink(?string $link): self
  136.     {
  137.         $this->link $link;
  138.         return $this;
  139.     }
  140.     public function getSequence(): ?int
  141.     {
  142.         return $this->sequence;
  143.     }
  144.     public function setSequence(?int $sequence): self
  145.     {
  146.         $this->sequence $sequence;
  147.         return $this;
  148.     }
  149.     public function getType(): ?string
  150.     {
  151.         return $this->type;
  152.     }
  153.     public function setType(?string $type): self
  154.     {
  155.         $this->type $type;
  156.         return $this;
  157.     }
  158.     public function getParent(): ?WebsiteParents
  159.     {
  160.         return $this->parent;
  161.     }
  162.     public function setParent(?WebsiteParents $parent): self
  163.     {
  164.         $this->parent $parent;
  165.         return $this;
  166.     }
  167.     public function getDescription(): ?string
  168.     {
  169.         return $this->description;
  170.     }
  171.     public function setDescription(?string $description): self
  172.     {
  173.         $this->description $description;
  174.         return $this;
  175.     }
  176.     public function getLinkPicture(): ?string
  177.     {
  178.         return $this->linkPicture;
  179.     }
  180.     public function setLinkPicture(?string $linkPicture): self
  181.     {
  182.         $this->linkPicture $linkPicture;
  183.         return $this;
  184.     }
  185. }