src/Entity/Article.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ArticleRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ArticleRepository::class)
  9.  */
  10. class Article
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $title;
  22.     /**
  23.      * @ORM\Column(type="text", nullable=true)
  24.      */
  25.     private $content;
  26.     /**
  27.      * @ORM\Column(type="string", length=255)
  28.      */
  29.     private $slug;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $locale;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private $type;
  38.     /**
  39.      * @ORM\Column(name="user", type="integer")
  40.      */
  41.     private $userId;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private $baseUrl;
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private $photoUrl;
  50.     /**
  51.      * @ORM\Column(type="string", length=255, nullable=true)
  52.      */
  53.     private $titleSeo;
  54.     /**
  55.      * @ORM\Column(type="string", length=255, nullable=true)
  56.      */
  57.     private $contentSeo;
  58.     /**
  59.      * @ORM\Column(type="boolean")
  60.      */
  61.     private $isActivated;
  62.     /**
  63.      * @ORM\Column(type="datetime_immutable")
  64.      */
  65.     private $createdAt;
  66.     /**
  67.      * @ORM\Column(type="datetime_immutable")
  68.      */
  69.     private $updatedAt;
  70.     /**
  71.      * @ORM\Column(type="datetime_immutable")
  72.      */
  73.     private $publishedAt;
  74.     /**
  75.      * @ORM\Column(type="datetime_immutable")
  76.      */
  77.     private $deletedAt;
  78.     /**
  79.      * @ORM\ManyToMany(targetEntity=Article::class)
  80.      */
  81.     private $categorieArticles;
  82.     public function __construct()
  83.     {
  84.         $this->categorieArticles = new ArrayCollection();
  85.     }
  86.     public function getId(): ?int
  87.     {
  88.         return $this->id;
  89.     }
  90.     public function getTitle(): ?string
  91.     {
  92.         return $this->title;
  93.     }
  94.     public function setTitle(string $title): self
  95.     {
  96.         $this->title $title;
  97.         return $this;
  98.     }
  99.     public function getContent(): ?string
  100.     {
  101.         return $this->content;
  102.     }
  103.     public function setContent(?string $content): self
  104.     {
  105.         $this->content $content;
  106.         return $this;
  107.     }
  108.     public function getSlug(): ?string
  109.     {
  110.         return $this->slug;
  111.     }
  112.     public function setSlug(string $slug): self
  113.     {
  114.         $this->slug $slug;
  115.         return $this;
  116.     }
  117.     public function getLocale(): ?string
  118.     {
  119.         return $this->locale;
  120.     }
  121.     public function setLocale(string $locale): self
  122.     {
  123.         $this->locale $locale;
  124.         return $this;
  125.     }
  126.     public function getType(): ?string
  127.     {
  128.         return $this->type;
  129.     }
  130.     public function setType(string $type): self
  131.     {
  132.         $this->type $type;
  133.         return $this;
  134.     }
  135.     public function getUserId(): ?int
  136.     {
  137.         return $this->userId;
  138.     }
  139.     public function setUserId(int $userId): self
  140.     {
  141.         $this->userId $userId;
  142.         return $this;
  143.     }
  144.     public function getBaseUrl(): ?string
  145.     {
  146.         return $this->baseUrl;
  147.     }
  148.     public function setBaseUrl(?string $baseUrl): self
  149.     {
  150.         $this->baseUrl $baseUrl;
  151.         return $this;
  152.     }
  153.     public function getPhotoUrl(): ?string
  154.     {
  155.         return $this->photoUrl;
  156.     }
  157.     public function setPhotoUrl(?string $photoUrl): self
  158.     {
  159.         $this->photoUrl $photoUrl;
  160.         return $this;
  161.     }
  162.     public function getTitleSeo(): ?string
  163.     {
  164.         return $this->titleSeo;
  165.     }
  166.     public function setTitleSeo(?string $titleSeo): self
  167.     {
  168.         $this->titleSeo $titleSeo;
  169.         return $this;
  170.     }
  171.     public function getContentSeo(): ?string
  172.     {
  173.         return $this->contentSeo;
  174.     }
  175.     public function setContentSeo(?string $contentSeo): self
  176.     {
  177.         $this->contentSeo $contentSeo;
  178.         return $this;
  179.     }
  180.     public function isIsActivated(): ?bool
  181.     {
  182.         return $this->isActivated;
  183.     }
  184.     public function setIsActivated(bool $isActivated): self
  185.     {
  186.         $this->isActivated $isActivated;
  187.         return $this;
  188.     }
  189.     public function getCreatedAt(): ?\DateTimeImmutable
  190.     {
  191.         return $this->createdAt;
  192.     }
  193.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  194.     {
  195.         $this->createdAt $createdAt;
  196.         return $this;
  197.     }
  198.     public function getUpdatedAt(): ?\DateTimeImmutable
  199.     {
  200.         return $this->updatedAt;
  201.     }
  202.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  203.     {
  204.         $this->updatedAt $updatedAt;
  205.         return $this;
  206.     }
  207.     public function getPublishedAt(): ?\DateTimeImmutable
  208.     {
  209.         return $this->publishedAt;
  210.     }
  211.     public function setPublishedAt(\DateTimeImmutable $publishedAt): self
  212.     {
  213.         $this->publishedAt $publishedAt;
  214.         return $this;
  215.     }
  216.     /**
  217.      * @return Collection<int, self>
  218.      */
  219.     public function getCategorieArticles(): Collection
  220.     {
  221.         return $this->categorieArticles;
  222.     }
  223.     public function addCategorieArticle(self $categorieArticle): self
  224.     {
  225.         if (!$this->categorieArticles->contains($categorieArticle)) {
  226.             $this->categorieArticles[] = $categorieArticle;
  227.         }
  228.         return $this;
  229.     }
  230.     public function removeCategorieArticle(self $categorieArticle): self
  231.     {
  232.         $this->categorieArticles->removeElement($categorieArticle);
  233.         return $this;
  234.     }
  235.     /**
  236.      * @return mixed
  237.      */
  238.     public function getDeletedAt()
  239.     {
  240.         return $this->deletedAt;
  241.     }
  242.     /**
  243.      * @param mixed $deletedAt
  244.      */
  245.     public function setDeletedAt($deletedAt): void
  246.     {
  247.         $this->deletedAt $deletedAt;
  248.     }
  249. }