<?php
namespace App\Entity;
use App\Repository\PostRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
/**
* @ORM\Entity(repositoryClass=PostRepository::class)
*/
class Post
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $uuid;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $token;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $slug;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $statut = false;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $titre;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $consultationCount = 0;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $visiteurCount = 0;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fichier;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="posts")
*/
private $user;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $ext;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $validedAt;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $moderate = false;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $mime;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nom;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $prenom;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $email;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $phone;
/**
* @ORM\ManyToOne(targetEntity=Direction::class, inversedBy="posts")
*/
private $direction;
/**
* @ORM\ManyToOne(targetEntity=Grade::class, inversedBy="posts")
*/
private $grade;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $fake;
/**
* @ORM\OneToMany(targetEntity=FichierPost::class, mappedBy="post")
*/
private $fichierPosts;
/**
* @ORM\OneToMany(targetEntity=Conversation::class, mappedBy="post")
*/
private $conversations;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $hashtag;
public function __construct()
{
$this->uuid = Uuid::v4();
$this->fichierPosts = new ArrayCollection();
$this->conversations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(?string $uuid): self
{
$this->uuid = $uuid;
return $this;
}
public function getToken(): ?string
{
return $this->token;
}
public function setToken(?string $token): self
{
$this->token = $token;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function isStatut(): ?bool
{
return $this->statut;
}
public function setStatut(?bool $statut): self
{
$this->statut = $statut;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(?string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getConsultationCount(): ?int
{
return $this->consultationCount;
}
public function setConsultationCount(?int $consultationCount): self
{
$this->consultationCount = $consultationCount;
return $this;
}
public function getVisiteurCount(): ?int
{
return $this->visiteurCount;
}
public function setVisiteurCount(?int $visiteurCount): self
{
$this->visiteurCount = $visiteurCount;
return $this;
}
public function getFichier(): ?string
{
return $this->fichier;
}
public function setFichier(?string $fichier): self
{
$this->fichier = $fichier;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getExt(): ?string
{
return $this->ext;
}
public function setExt(?string $ext): self
{
$this->ext = $ext;
return $this;
}
public function getValidedAt(): ?\DateTimeImmutable
{
return $this->validedAt;
}
public function setValidedAt(?\DateTimeImmutable $validedAt): self
{
$this->validedAt = $validedAt;
return $this;
}
public function isModerate(): ?bool
{
return $this->moderate;
}
public function setModerate(?bool $moderate): self
{
$this->moderate = $moderate;
return $this;
}
public function getMime(): ?string
{
return $this->mime;
}
public function setMime(?string $mime): self
{
$this->mime = $mime;
return $this;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(?string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getPrenom(): ?string
{
return $this->prenom;
}
public function setPrenom(?string $prenom): self
{
$this->prenom = $prenom;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getDirection(): ?Direction
{
return $this->direction;
}
public function setDirection(?Direction $direction): self
{
$this->direction = $direction;
return $this;
}
public function getGrade(): ?Grade
{
return $this->grade;
}
public function setGrade(?Grade $grade): self
{
$this->grade = $grade;
return $this;
}
public function isFake(): ?bool
{
return $this->fake;
}
public function setFake(?bool $fake): self
{
$this->fake = $fake;
return $this;
}
/**
* @return Collection<int, FichierPost>
*/
public function getFichierPosts(): Collection
{
return $this->fichierPosts;
}
public function addFichierPost(FichierPost $fichierPost): self
{
if (!$this->fichierPosts->contains($fichierPost)) {
$this->fichierPosts[] = $fichierPost;
$fichierPost->setPost($this);
}
return $this;
}
public function removeFichierPost(FichierPost $fichierPost): self
{
if ($this->fichierPosts->removeElement($fichierPost)) {
// set the owning side to null (unless already changed)
if ($fichierPost->getPost() === $this) {
$fichierPost->setPost(null);
}
}
return $this;
}
/**
* @return Collection<int, Conversation>
*/
public function getConversations(): Collection
{
return $this->conversations;
}
public function addConversation(Conversation $conversation): self
{
if (!$this->conversations->contains($conversation)) {
$this->conversations[] = $conversation;
$conversation->setPost($this);
}
return $this;
}
public function removeConversation(Conversation $conversation): self
{
if ($this->conversations->removeElement($conversation)) {
// set the owning side to null (unless already changed)
if ($conversation->getPost() === $this) {
$conversation->setPost(null);
}
}
return $this;
}
public function getHashtag(): ?string
{
return $this->hashtag;
}
public function setHashtag(?string $hashtag): self
{
$this->hashtag = $hashtag;
return $this;
}
}