src/Entity/Sujetforum.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SujetforumRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassSujetforumRepository::class)]
  9. class Sujetforum
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $sujet null;
  17.     #[ORM\Column(typeTypes::TEXTlength:10000)]
  18.     private ?string $description null;
  19.     #[ORM\Column(type'boolean')]
  20.     private $isPublic false;
  21.     #[ORM\ManyToOne()]
  22.     private ?User $user null;
  23.     #[ORM\Column(type'date',nullable:true)]
  24.     private $date null;
  25.     #[ORM\Column(type'date',nullable:true)]
  26.     private $date_public null;
  27.     #[ORM\OneToMany(mappedBy'sujetforum'targetEntityForumReponse::class, cascade: ['remove'])]
  28.     private Collection $reponse;
  29.     public function __construct()
  30.     {
  31.         $this->reponse = new ArrayCollection();
  32.     }
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getUser(): ?User
  38.     {
  39.         return $this->user;
  40.     }
  41.     public function setUser(?User $user): ?self
  42.     {
  43.         $this->user $user;
  44.         return $this;
  45.     }
  46.     public function getSujet(): ?string
  47.     {
  48.         return $this->sujet;
  49.     }
  50.     public function setSujet(string $sujet): self
  51.     {
  52.         $this->sujet $sujet;
  53.         return $this;
  54.     }
  55.     public function getDescription(): ?string
  56.     {
  57.         return $this->description;
  58.     }
  59.     public function setDescription(string $description): self
  60.     {
  61.         $this->description $description;
  62.         return $this;
  63.     }
  64.     public function isIsPublic(): ?bool
  65.     {
  66.         return $this->isPublic;
  67.     }
  68.     public function setIsPublic(bool $isPublic): self
  69.     {
  70.         $this->isPublic $isPublic;
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection<int, ForumReponse>
  75.      */
  76.     public function getReponse(): Collection
  77.     {
  78.         return $this->reponse;
  79.     }
  80.     public function addReponse(ForumReponse $reponse): self
  81.     {
  82.         if (!$this->reponse->contains($reponse)) {
  83.             $this->reponse->add($reponse);
  84.             $reponse->setSujetforum($this);
  85.         }
  86.         return $this;
  87.     }
  88.     public function removeReponse(ForumReponse $reponse): self
  89.     {
  90.         if ($this->reponse->removeElement($reponse)) {
  91.             // set the owning side to null (unless already changed)
  92.             if ($reponse->getSujetforum() === $this) {
  93.                 $reponse->setSujetforum(null);
  94.             }
  95.         }
  96.         return $this;
  97.     }
  98.     public function __toString()
  99.     {
  100.         return $this->sujet;
  101.     }
  102.     public function getDate(): ?\DateTimeInterface
  103.     {
  104.         return $this->date;
  105.     }
  106.     public function setDate(\DateTimeInterface $date): self
  107.     {
  108.         $this->date $date;
  109.         return $this;
  110.     }
  111.     /**
  112.      * @return null
  113.      */
  114.     public function getDatePublic()
  115.     {
  116.         return $this->date_public;
  117.     }
  118.     /**
  119.      * @param null $date_public
  120.      */
  121.     public function setDatePublic($date_public): void
  122.     {
  123.         $this->date_public $date_public;
  124.     }
  125.     
  126. }