src/Entity/PostReponses.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PostReponsesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPostReponsesRepository::class)]
  8. class PostReponses
  9. {
  10.   #[ORM\Id]
  11.   #[ORM\GeneratedValue]
  12.   #[ORM\Column(type'integer')]
  13.   private int $id;
  14.   #[ORM\Column(type'string'length255nullabletrue)]
  15.   private ?string $texte null;
  16.   #[ORM\ManyToMany(targetEntityPost::class, mappedBy'reponses')]
  17.   private mixed $posts;
  18.   #[ORM\Column(type'integer'nullabletrue)]
  19.   private ?int $count 0;
  20.   #[ORM\Column(type'boolean'nullabletrue)]
  21.   private ?bool $valide;
  22.   public function __construct()
  23.   {
  24.     $this->posts = new ArrayCollection();
  25.   }
  26.   public function getId(): ?int
  27.   {
  28.     return $this->id;
  29.   }
  30.   public function getTexte(): ?string
  31.   {
  32.     return $this->texte;
  33.   }
  34.   public function setTexte(?string $texte): self
  35.   {
  36.     $this->texte $texte;
  37.     return $this;
  38.   }
  39.   /**
  40.    * @return Collection
  41.    */
  42.   public function getPosts(): Collection
  43.   {
  44.     return $this->posts;
  45.   }
  46.   public function addPost(Post $post): self
  47.   {
  48.     if (!$this->posts->contains($post)) {
  49.       $this->posts[] = $post;
  50.       $post->addReponse($this);
  51.     }
  52.     return $this;
  53.   }
  54.   public function removePost(Post $post): self
  55.   {
  56.     if ($this->posts->contains($post)) {
  57.       $this->posts->removeElement($post);
  58.       $post->removeReponse($this);
  59.     }
  60.     return $this;
  61.   }
  62.   public function getCount(): ?int
  63.   {
  64.     return $this->count;
  65.   }
  66.   public function setCount(?int $count): self
  67.   {
  68.     $this->count $count;
  69.     return $this;
  70.   }
  71.   public function __toString(): string
  72.   {
  73.     return (string)$this->texte;
  74.   }
  75.   public function getValide(): ?bool
  76.   {
  77.     return $this->valide;
  78.   }
  79.   public function setValide(?bool $valide): self
  80.   {
  81.     $this->valide $valide;
  82.     return $this;
  83.   }
  84. }