<?phpnamespace App\Entity;use App\Repository\ProjetRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\HasLifecycleCallbacks() * @ORM\Entity(repositoryClass=ProjetRepository::class) */class Projet{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="text", nullable=true) */ private $themeCss; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $banner; /** * @ORM\ManyToOne(targetEntity=Client::class, inversedBy="projets") */ private $client; /** * @ORM\Column(type="datetime", nullable=true) */ private $createdAt; /** * @ORM\Column(type="datetime") */ private $updatedAt; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\ManyToMany(targetEntity=Rubrique::class, mappedBy="projet") */ private $rubriques; /** * @ORM\OneToMany(targetEntity=ClientProduit::class, mappedBy="projet") */ private $clientProduits; /** * @ORM\OneToMany(targetEntity=Groupe::class, mappedBy="projet") */ private $groupes; public function __construct() { $this->rubriques = new ArrayCollection(); $this->clientProduits = new ArrayCollection(); $this->groupes = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getThemeCss(): ?string { return $this->themeCss; } public function setThemeCss(?string $themeCss): self { $this->themeCss = $themeCss; return $this; } public function getBanner(): ?string { return $this->banner; } public function setBanner(?string $banner): self { $this->banner = $banner; return $this; } public function getClient(): ?Client { return $this->client; } public function setClient(?Client $client): self { $this->client = $client; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(?\DateTimeInterface $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 getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } /** * @ORM\PrePersist * @ORM\PreUpdate */ public function updateTimer() { if ($this->getCreatedAt() == null) { $this->setCreatedAt(new \DateTime()); } $this->setUpdatedAt(new \DateTime()); } /** * @return Collection|Rubrique[] */ public function getRubriques(): Collection { return $this->rubriques; } public function addRubrique(Rubrique $rubrique): self { if (!$this->rubriques->contains($rubrique)) { $this->rubriques[] = $rubrique; $rubrique->addProjet($this); } return $this; } public function removeRubrique(Rubrique $rubrique): self { if ($this->rubriques->removeElement($rubrique)) { $rubrique->removeProjet($this); } return $this; } /** * @return Collection|ClientProduit[] */ public function getClientProduits(): Collection { return $this->clientProduits; } public function addClientProduit(ClientProduit $clientProduit): self { if (!$this->clientProduits->contains($clientProduit)) { $this->clientProduits[] = $clientProduit; $clientProduit->setProjet($this); } return $this; } public function removeClientProduit(ClientProduit $clientProduit): self { if ($this->clientProduits->removeElement($clientProduit)) { // set the owning side to null (unless already changed) if ($clientProduit->getProjet() === $this) { $clientProduit->setProjet(null); } } return $this; } /** * @return Collection|Groupe[] */ public function getGroupes(): Collection { return $this->groupes; } public function addGroupe(Groupe $groupe): self { if (!$this->groupes->contains($groupe)) { $this->groupes[] = $groupe; $groupe->setProjet($this); } return $this; } public function removeGroupe(Groupe $groupe): self { if ($this->groupes->removeElement($groupe)) { // set the owning side to null (unless already changed) if ($groupe->getProjet() === $this) { $groupe->setProjet(null); } } return $this; }}