src/Entity/Fiches/Articles.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Fiches;
  3. use App\Entity\Core\Users;
  4. use Doctrine\DBAL\Types\Types;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. use Symfony\Component\HttpFoundation\File\File;
  11. use App\Repository\Fiches\ArticlesRepository;
  12. use Symfony\Component\HttpFoundation\File\UploadedFile;
  13. use Vich\UploaderBundle\Entity\File as EmbeddedFile;
  14. /**
  15.  * Articles
  16.  *
  17.  * @ORM\Table("fiches_articles")
  18.  * @ORM\Entity(repositoryClass=ArticlesRepository::class)
  19.  * @ORM\HasLifecycleCallbacks()
  20.  * @Vich\Uploadable
  21.  */
  22. class Articles {
  23.     /**
  24.      * @var integer
  25.      *
  26.      * @ORM\Column(name="id", type="integer")
  27.      * @ORM\Id
  28.      * @ORM\GeneratedValue(strategy="AUTO")
  29.      * [Groups(['list', 'item'])]
  30.      */
  31.     protected $id;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"})
  36.      */
  37.     private $createdAt;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"})
  42.      */
  43.     private $updatedAt;
  44.     /**
  45.      * @var string
  46.      *
  47.      * @ORM\Column(name="locale", type="string", length=255, nullable=true)
  48.      */
  49.     private $locale;
  50.     /**
  51.      * @var string
  52.      *
  53.      * @ORM\Column(name="title", type="string", length=500, nullable=true)
  54.      */
  55.     private $title;
  56.     /**
  57.      * @var string
  58.      *
  59.      * @ORM\Column(name="short_title", type="string", length=255, nullable=true)
  60.      */
  61.     private $shortTitle;
  62.     /**
  63.      * @var string
  64.      *
  65.      * @ORM\Column(name="short_description", type="text", nullable=true)
  66.      */
  67.     private $shortDescription;
  68.     /**
  69.      * @var string
  70.      *
  71.      * @ORM\Column(name="folder_slug", type="string", length=255, nullable=true)
  72.      */
  73.     private $folderSlug;
  74.     /**
  75.      * @var string
  76.      *
  77.      * @ORM\Column(name="folder_slug2", type="string", length=255, nullable=true)
  78.      */
  79.     private $folderSlug2;
  80.     /**
  81.      * @var string
  82.      *
  83.      * @ORM\Column(name="folder_slug3", type="string", length=255, nullable=true)
  84.      */
  85.     private $folderSlug3;
  86.     /**
  87.      * @var string
  88.      *
  89.      * @ORM\Column(name="tag", type="string", length=255, nullable=true)
  90.      */
  91.     private $tag;
  92.     /**
  93.      * @var \Categories
  94.      *
  95.      * @ORM\ManyToOne(targetEntity="App\Entity\Fiches\Categories")
  96.      * @ORM\JoinColumns({
  97.      *   @ORM\JoinColumn(name="category_id", referencedColumnName="id", nullable=true)
  98.      * })
  99.      */
  100.     protected $category;
  101.     /**
  102.      * @var string
  103.      *
  104.      * @ORM\Column(name="description", type="text", nullable=true)
  105.      */
  106.     private $description;
  107.     /**
  108.      * @var string
  109.      *
  110.      * @ORM\Column(name="description_premium", type="text", nullable=true)
  111.      */
  112.     private $descriptionPremium;
  113.     /**
  114.      * @var string
  115.      *
  116.      * @ORM\Column(name="private_email", type="text", nullable=true)
  117.      */
  118.     private $privateEmail;
  119.     /**
  120.      * @var \Users
  121.      *
  122.      * @ORM\ManyToOne(targetEntity="App\Entity\Core\Users")
  123.      * @ORM\JoinColumns({
  124.      *   @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
  125.      * })
  126.      */
  127.     protected $user;
  128.     /**
  129.      * @var string
  130.      *
  131.      * @ORM\Column(name="status", type="string", length=255, nullable=true)
  132.      */
  133.     private $status;
  134.     /**
  135.      * @var string
  136.      *
  137.      * @ORM\Column(name="theme", type="string", length=255, nullable=true)
  138.      */
  139.     private $theme;
  140.     /**
  141.      * @ORM\PrePersist
  142.      */
  143.     public function setCreatedAtValue(): void {
  144.         $this->setCreatedAt(new \DateTime("now"));
  145.         $this->setUpdatedAt(new \DateTime("now"));
  146.     }
  147.     /**
  148.      * @ORM\PreUpdate
  149.      */
  150.     public function setUpdatedAtValue(): void {
  151.         $this->setUpdatedAt(new \DateTime("now"));
  152.     }
  153.     public function __toString()
  154.     {
  155.         return $this->title;
  156.     }
  157.     public function getId(): ?int
  158.     {
  159.         return $this->id;
  160.     }
  161.     public function getCreatedAt(): ?\DateTimeInterface
  162.     {
  163.         return $this->createdAt;
  164.     }
  165.     public function setCreatedAt(?\DateTimeInterface $createdAt): static
  166.     {
  167.         $this->createdAt $createdAt;
  168.         return $this;
  169.     }
  170.     public function getUpdatedAt(): ?\DateTimeInterface
  171.     {
  172.         return $this->updatedAt;
  173.     }
  174.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
  175.     {
  176.         $this->updatedAt $updatedAt;
  177.         return $this;
  178.     }
  179.     public function getTitle(): ?string
  180.     {
  181.         return $this->title;
  182.     }
  183.     public function setTitle(?string $title): static
  184.     {
  185.         $this->title $title;
  186.         return $this;
  187.     }
  188.     public function getShortTitle(): ?string
  189.     {
  190.         return $this->shortTitle;
  191.     }
  192.     public function setShortTitle(?string $shortTitle): static
  193.     {
  194.         $this->shortTitle $shortTitle;
  195.         return $this;
  196.     }
  197.     public function getShortDescription(): ?string
  198.     {
  199.         return $this->shortDescription;
  200.     }
  201.     public function setShortDescription(?string $shortDescription): static
  202.     {
  203.         $this->shortDescription $shortDescription;
  204.         return $this;
  205.     }
  206.     public function getFolderSlug(): ?string
  207.     {
  208.         return $this->folderSlug;
  209.     }
  210.     public function setFolderSlug(?string $folderSlug): static
  211.     {
  212.         $this->folderSlug $folderSlug;
  213.         return $this;
  214.     }
  215.     public function getFolderSlug2(): ?string
  216.     {
  217.         return $this->folderSlug2;
  218.     }
  219.     public function setFolderSlug2(?string $folderSlug2): static
  220.     {
  221.         $this->folderSlug2 $folderSlug2;
  222.         return $this;
  223.     }
  224.     public function getFolderSlug3(): ?string
  225.     {
  226.         return $this->folderSlug3;
  227.     }
  228.     public function setFolderSlug3(?string $folderSlug3): static
  229.     {
  230.         $this->folderSlug3 $folderSlug3;
  231.         return $this;
  232.     }
  233.     public function getTag(): ?string
  234.     {
  235.         return $this->tag;
  236.     }
  237.     public function setTag(?string $tag): static
  238.     {
  239.         $this->tag $tag;
  240.         return $this;
  241.     }
  242.     public function getDescription(): ?string
  243.     {
  244.         return $this->description;
  245.     }
  246.     public function setDescription(?string $description): static
  247.     {
  248.         $this->description $description;
  249.         return $this;
  250.     }
  251.     public function getDescriptionPremium(): ?string
  252.     {
  253.         return $this->descriptionPremium;
  254.     }
  255.     public function setDescriptionPremium(?string $descriptionPremium): static
  256.     {
  257.         $this->descriptionPremium $descriptionPremium;
  258.         return $this;
  259.     }
  260.     public function getStatus(): ?string
  261.     {
  262.         return $this->status;
  263.     }
  264.     public function setStatus(?string $status): static
  265.     {
  266.         $this->status $status;
  267.         return $this;
  268.     }
  269.     public function getTheme(): ?string
  270.     {
  271.         return $this->theme;
  272.     }
  273.     public function setTheme(?string $theme): static
  274.     {
  275.         $this->theme $theme;
  276.         return $this;
  277.     }
  278.     public function getCategory(): ?Categories
  279.     {
  280.         return $this->category;
  281.     }
  282.     public function setCategory(?Categories $category): static
  283.     {
  284.         $this->category $category;
  285.         return $this;
  286.     }
  287.     public function getUser(): ?Users
  288.     {
  289.         return $this->user;
  290.     }
  291.     public function setUser(?Users $user): static
  292.     {
  293.         $this->user $user;
  294.         return $this;
  295.     }
  296.     public function getPrivateEmail(): ?string
  297.     {
  298.         return $this->privateEmail;
  299.     }
  300.     public function setPrivateEmail(?string $descriptionPremium): static
  301.     {
  302.         $this->privateEmail $descriptionPremium;
  303.         return $this;
  304.     }
  305.     public function getLocale(): ?string
  306.     {
  307.         return $this->locale;
  308.     }
  309.     public function setLocale(?string $locale): static
  310.     {
  311.         $this->locale $locale;
  312.         return $this;
  313.     }
  314. }