src/Entity/Post.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PostRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Uid\Uuid;
  8. /**
  9.  * @ORM\Entity(repositoryClass=PostRepository::class)
  10.  */
  11. class Post
  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, nullable=true)
  21.      */
  22.     private $uuid;
  23.     /**
  24.      * @ORM\Column(type="string", length=255, nullable=true)
  25.      */
  26.     private $token;
  27.     /**
  28.      * @ORM\Column(type="string", length=255, nullable=true)
  29.      */
  30.     private $slug;
  31.     /**
  32.      * @ORM\Column(type="boolean", nullable=true)
  33.      */
  34.     private $statut false;
  35.     /**
  36.      * @ORM\Column(type="datetime_immutable", nullable=true)
  37.      */
  38.     private $createdAt;
  39.     /**
  40.      * @ORM\Column(type="datetime", nullable=true)
  41.      */
  42.     private $updatedAt;
  43.     /**
  44.      * @ORM\Column(type="string", length=255, nullable=true)
  45.      */
  46.     private $titre;
  47.     /**
  48.      * @ORM\Column(type="text", nullable=true)
  49.      */
  50.     private $description;
  51.     /**
  52.      * @ORM\Column(type="integer", nullable=true)
  53.      */
  54.     private $consultationCount 0;
  55.     /**
  56.      * @ORM\Column(type="integer", nullable=true)
  57.      */
  58.     private $visiteurCount 0;
  59.     /**
  60.      * @ORM\Column(type="string", length=255, nullable=true)
  61.      */
  62.     private $fichier;
  63.     /**
  64.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="posts")
  65.      */
  66.     private $user;
  67.     /**
  68.      * @ORM\Column(type="string", length=255, nullable=true)
  69.      */
  70.     private $ext;
  71.     /**
  72.      * @ORM\Column(type="datetime_immutable", nullable=true)
  73.      */
  74.     private $validedAt;
  75.     /**
  76.      * @ORM\Column(type="boolean", nullable=true)
  77.      */
  78.     private $moderate false;
  79.     /**
  80.      * @ORM\Column(type="string", length=255, nullable=true)
  81.      */
  82.     private $mime;
  83.     /**
  84.      * @ORM\Column(type="string", length=255, nullable=true)
  85.      */
  86.     private $nom;
  87.     /**
  88.      * @ORM\Column(type="string", length=255, nullable=true)
  89.      */
  90.     private $prenom;
  91.     /**
  92.      * @ORM\Column(type="string", length=255, nullable=true)
  93.      */
  94.     private $email;
  95.     /**
  96.      * @ORM\Column(type="string", length=255, nullable=true)
  97.      */
  98.     private $phone;
  99.     /**
  100.      * @ORM\ManyToOne(targetEntity=Direction::class, inversedBy="posts")
  101.      */
  102.     private $direction;
  103.     /**
  104.      * @ORM\ManyToOne(targetEntity=Grade::class, inversedBy="posts")
  105.      */
  106.     private $grade;
  107.     /**
  108.      * @ORM\Column(type="boolean", nullable=true)
  109.      */
  110.     private $fake;
  111.     /**
  112.      * @ORM\OneToMany(targetEntity=FichierPost::class, mappedBy="post")
  113.      */
  114.     private $fichierPosts;
  115.     /**
  116.      * @ORM\OneToMany(targetEntity=Conversation::class, mappedBy="post")
  117.      */
  118.     private $conversations;
  119.     /**
  120.      * @ORM\Column(type="string", length=255, nullable=true)
  121.      */
  122.     private $hashtag;
  123.     public function __construct()
  124.     {
  125.         $this->uuid Uuid::v4();
  126.         $this->fichierPosts = new ArrayCollection();
  127.         $this->conversations = new ArrayCollection();
  128.     }
  129.     public function getId(): ?int
  130.     {
  131.         return $this->id;
  132.     }
  133.     public function getUuid(): ?string
  134.     {
  135.         return $this->uuid;
  136.     }
  137.     public function setUuid(?string $uuid): self
  138.     {
  139.         $this->uuid $uuid;
  140.         return $this;
  141.     }
  142.     public function getToken(): ?string
  143.     {
  144.         return $this->token;
  145.     }
  146.     public function setToken(?string $token): self
  147.     {
  148.         $this->token $token;
  149.         return $this;
  150.     }
  151.     public function getSlug(): ?string
  152.     {
  153.         return $this->slug;
  154.     }
  155.     public function setSlug(?string $slug): self
  156.     {
  157.         $this->slug $slug;
  158.         return $this;
  159.     }
  160.     public function isStatut(): ?bool
  161.     {
  162.         return $this->statut;
  163.     }
  164.     public function setStatut(?bool $statut): self
  165.     {
  166.         $this->statut $statut;
  167.         return $this;
  168.     }
  169.     public function getCreatedAt(): ?\DateTimeImmutable
  170.     {
  171.         return $this->createdAt;
  172.     }
  173.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  174.     {
  175.         $this->createdAt $createdAt;
  176.         return $this;
  177.     }
  178.     public function getUpdatedAt(): ?\DateTimeInterface
  179.     {
  180.         return $this->updatedAt;
  181.     }
  182.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  183.     {
  184.         $this->updatedAt $updatedAt;
  185.         return $this;
  186.     }
  187.     public function getTitre(): ?string
  188.     {
  189.         return $this->titre;
  190.     }
  191.     public function setTitre(?string $titre): self
  192.     {
  193.         $this->titre $titre;
  194.         return $this;
  195.     }
  196.     public function getDescription(): ?string
  197.     {
  198.         return $this->description;
  199.     }
  200.     public function setDescription(?string $description): self
  201.     {
  202.         $this->description $description;
  203.         return $this;
  204.     }
  205.     public function getConsultationCount(): ?int
  206.     {
  207.         return $this->consultationCount;
  208.     }
  209.     public function setConsultationCount(?int $consultationCount): self
  210.     {
  211.         $this->consultationCount $consultationCount;
  212.         return $this;
  213.     }
  214.     public function getVisiteurCount(): ?int
  215.     {
  216.         return $this->visiteurCount;
  217.     }
  218.     public function setVisiteurCount(?int $visiteurCount): self
  219.     {
  220.         $this->visiteurCount $visiteurCount;
  221.         return $this;
  222.     }
  223.     public function getFichier(): ?string
  224.     {
  225.         return $this->fichier;
  226.     }
  227.     public function setFichier(?string $fichier): self
  228.     {
  229.         $this->fichier $fichier;
  230.         return $this;
  231.     }
  232.     public function getUser(): ?User
  233.     {
  234.         return $this->user;
  235.     }
  236.     public function setUser(?User $user): self
  237.     {
  238.         $this->user $user;
  239.         return $this;
  240.     }
  241.     public function getExt(): ?string
  242.     {
  243.         return $this->ext;
  244.     }
  245.     public function setExt(?string $ext): self
  246.     {
  247.         $this->ext $ext;
  248.         return $this;
  249.     }
  250.     public function getValidedAt(): ?\DateTimeImmutable
  251.     {
  252.         return $this->validedAt;
  253.     }
  254.     public function setValidedAt(?\DateTimeImmutable $validedAt): self
  255.     {
  256.         $this->validedAt $validedAt;
  257.         return $this;
  258.     }
  259.     public function isModerate(): ?bool
  260.     {
  261.         return $this->moderate;
  262.     }
  263.     public function setModerate(?bool $moderate): self
  264.     {
  265.         $this->moderate $moderate;
  266.         return $this;
  267.     }
  268.     public function getMime(): ?string
  269.     {
  270.         return $this->mime;
  271.     }
  272.     public function setMime(?string $mime): self
  273.     {
  274.         $this->mime $mime;
  275.         return $this;
  276.     }
  277.     public function getNom(): ?string
  278.     {
  279.         return $this->nom;
  280.     }
  281.     public function setNom(?string $nom): self
  282.     {
  283.         $this->nom $nom;
  284.         return $this;
  285.     }
  286.     public function getPrenom(): ?string
  287.     {
  288.         return $this->prenom;
  289.     }
  290.     public function setPrenom(?string $prenom): self
  291.     {
  292.         $this->prenom $prenom;
  293.         return $this;
  294.     }
  295.     public function getEmail(): ?string
  296.     {
  297.         return $this->email;
  298.     }
  299.     public function setEmail(?string $email): self
  300.     {
  301.         $this->email $email;
  302.         return $this;
  303.     }
  304.     public function getPhone(): ?string
  305.     {
  306.         return $this->phone;
  307.     }
  308.     public function setPhone(?string $phone): self
  309.     {
  310.         $this->phone $phone;
  311.         return $this;
  312.     }
  313.     public function getDirection(): ?Direction
  314.     {
  315.         return $this->direction;
  316.     }
  317.     public function setDirection(?Direction $direction): self
  318.     {
  319.         $this->direction $direction;
  320.         return $this;
  321.     }
  322.     public function getGrade(): ?Grade
  323.     {
  324.         return $this->grade;
  325.     }
  326.     public function setGrade(?Grade $grade): self
  327.     {
  328.         $this->grade $grade;
  329.         return $this;
  330.     }
  331.     public function isFake(): ?bool
  332.     {
  333.         return $this->fake;
  334.     }
  335.     public function setFake(?bool $fake): self
  336.     {
  337.         $this->fake $fake;
  338.         return $this;
  339.     }
  340.     /**
  341.      * @return Collection<int, FichierPost>
  342.      */
  343.     public function getFichierPosts(): Collection
  344.     {
  345.         return $this->fichierPosts;
  346.     }
  347.     public function addFichierPost(FichierPost $fichierPost): self
  348.     {
  349.         if (!$this->fichierPosts->contains($fichierPost)) {
  350.             $this->fichierPosts[] = $fichierPost;
  351.             $fichierPost->setPost($this);
  352.         }
  353.         return $this;
  354.     }
  355.     public function removeFichierPost(FichierPost $fichierPost): self
  356.     {
  357.         if ($this->fichierPosts->removeElement($fichierPost)) {
  358.             // set the owning side to null (unless already changed)
  359.             if ($fichierPost->getPost() === $this) {
  360.                 $fichierPost->setPost(null);
  361.             }
  362.         }
  363.         return $this;
  364.     }
  365.     /**
  366.      * @return Collection<int, Conversation>
  367.      */
  368.     public function getConversations(): Collection
  369.     {
  370.         return $this->conversations;
  371.     }
  372.     public function addConversation(Conversation $conversation): self
  373.     {
  374.         if (!$this->conversations->contains($conversation)) {
  375.             $this->conversations[] = $conversation;
  376.             $conversation->setPost($this);
  377.         }
  378.         return $this;
  379.     }
  380.     public function removeConversation(Conversation $conversation): self
  381.     {
  382.         if ($this->conversations->removeElement($conversation)) {
  383.             // set the owning side to null (unless already changed)
  384.             if ($conversation->getPost() === $this) {
  385.                 $conversation->setPost(null);
  386.             }
  387.         }
  388.         return $this;
  389.     }
  390.     public function getHashtag(): ?string
  391.     {
  392.         return $this->hashtag;
  393.     }
  394.     public function setHashtag(?string $hashtag): self
  395.     {
  396.         $this->hashtag $hashtag;
  397.         return $this;
  398.     }
  399. }