src/Entity/Projets.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjetsRepository;
  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(repositoryClassProjetsRepository::class)]
  9. class Projets
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length100)]
  16.     private ?string $name null;
  17.     #[ORM\Column(typeTypes::TEXT)]
  18.     private ?string $description null;
  19.     #[ORM\ManyToOne(inversedBy'projets')]
  20.     private ?Categories $category null;
  21.     #[ORM\ManyToOne(inversedBy'projets')]
  22.     private ?Difficultes $difficulty null;
  23.     #[ORM\OneToMany(mappedBy'projet'targetEntityUserProjets::class, cascade: ['persist''remove'])]
  24.     private Collection $userProjets;
  25.     #[ORM\OneToMany(mappedBy'projet'targetEntityImageSlider::class, cascade: ['persist''remove'])]
  26.     private Collection $imageSliders;
  27.     #[ORM\Column]
  28.     private ?bool $isValidated null;
  29.     #[ORM\Column(nullabletrue)]
  30.     private ?\DateTimeImmutable $createdAt null;
  31.     public function __construct()
  32.     {
  33.         $this->userProjets = new ArrayCollection();
  34.         $this->imageSliders = new ArrayCollection();
  35.         $this->isValidated false;
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getName(): ?string
  42.     {
  43.         return $this->name;
  44.     }
  45.     public function setName(string $name): static
  46.     {
  47.         $this->name $name;
  48.         return $this;
  49.     }
  50.     public function getDescription(): ?string
  51.     {
  52.         return $this->description;
  53.     }
  54.     public function setDescription(string $description): static
  55.     {
  56.         $this->description $description;
  57.         return $this;
  58.     }
  59.     public function getCategory(): ?Categories
  60.     {
  61.         return $this->category;
  62.     }
  63.     public function setCategory(?Categories $category): static
  64.     {
  65.         $this->category $category;
  66.         return $this;
  67.     }
  68.     public function getDifficulty(): ?Difficultes
  69.     {
  70.         return $this->difficulty;
  71.     }
  72.     public function setDifficulty(?Difficultes $difficulty): static
  73.     {
  74.         $this->difficulty $difficulty;
  75.         return $this;
  76.     }
  77.     /**
  78.      * @return Collection<int, UserProjets>
  79.      */
  80.     public function getUserProjets(): Collection
  81.     {
  82.         return $this->userProjets;
  83.     }
  84.     public function addUserProjet(UserProjets $userProjet): self
  85.     {
  86.         if (!$this->userProjets->contains($userProjet)) {
  87.             $this->userProjets->add($userProjet);
  88.             $userProjet->setProjet($this);
  89.         }
  90.         return $this;
  91.     }
  92.     public function removeUserProjet(UserProjets $userProjet): self
  93.     {
  94.         if ($this->userProjets->removeElement($userProjet)) {
  95.             // set the owning side to null (unless already changed)
  96.             if ($userProjet->getProjet() === $this) {
  97.                 $userProjet->setProjet(null);
  98.             }
  99.         }
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return Collection<int, ImageSlider>
  104.      */
  105.     public function getImageSliders(): Collection
  106.     {
  107.         return $this->imageSliders;
  108.     }
  109.     public function addImageSlider(ImageSlider $imageSlider): self
  110.     {
  111.         if (!$this->imageSliders->contains($imageSlider)) {
  112.             $this->imageSliders->add($imageSlider);
  113.             $imageSlider->setProjet($this);
  114.         }
  115.         return $this;
  116.     }
  117.     public function removeImageSlider(ImageSlider $imageSlider): self
  118.     {
  119.         if ($this->imageSliders->removeElement($imageSlider)) {
  120.             // set the owning side to null (unless already changed)
  121.             if ($imageSlider->getProjet() === $this) {
  122.                 $imageSlider->setProjet(null);
  123.             }
  124.         }
  125.         return $this;
  126.     }
  127.     public function isValidated(): ?bool
  128.     {
  129.         return $this->isValidated;
  130.     }
  131.     public function setIsValidated(bool $isValidated): self
  132.     {
  133.         $this->isValidated $isValidated;
  134.         return $this;
  135.     }
  136.     public function getCreatedAt(): ?\DateTimeImmutable
  137.     {
  138.         return $this->createdAt;
  139.     }
  140.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  141.     {
  142.         $this->createdAt $createdAt;
  143.         return $this;
  144.     }
  145. }