<?phpnamespace App\Entity\Boutique\Cours;use App\Entity\Media\Media;use App\Entity\PostType\PostTypeProduit;use App\Entity\User\Coach;use App\Entity\User\Skills;use App\Repository\Boutique\Cours\CoursRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CoursRepository::class)]class Cours extends PostTypeProduit{ #[ORM\Column(type: Types::TEXT)] private ?string $description = null; #[ORM\Column] private ?\DateTimeImmutable $date = null; #[ORM\Column] private ?int $duree = null; #[ORM\ManyToOne(inversedBy: 'cours')] private ?Media $media = null; #[ORM\ManyToMany(targetEntity: Skills::class, inversedBy: 'cours')] private Collection $skills; #[ORM\ManyToMany(targetEntity: Coach::class, mappedBy: 'cours', cascade: ['persist'])] private Collection $coaches; #[ORM\Column(length: 255)] private ?string $accroche = null; public function __construct() { parent::__construct(); date_default_timezone_set('Europe/Paris'); $this->skills = new ArrayCollection(); $this->coaches = new ArrayCollection(); } public function getDescription(): ?string { return $this->description; } public function setDescription(string $description): self { $this->description = $description; return $this; } public function getDate(): ?\DateTimeImmutable { return $this->date; } public function setDate(\DateTimeImmutable $date): self { $this->date = $date; return $this; } public function getDuree(): ?int { return $this->duree; } public function setDuree(int $duree): self { $this->duree = $duree; return $this; } public function getMedia(): ?Media { return $this->media; } public function setMedia(?Media $media): self { $this->media = $media; return $this; } /** * @return Collection<int, Skills> */ public function getSkills(): Collection { return $this->skills; } public function addSkill(Skills $skill): self { if (!$this->skills->contains($skill)) { $this->skills->add($skill); } return $this; } public function removeSkill(Skills $skill): self { $this->skills->removeElement($skill); return $this; } /** * @return Collection<int, Coach> */ public function getCoaches(): Collection { return $this->coaches; } public function addCoach(Coach $coach): self { if (!$this->coaches->contains($coach)) { $this->coaches->add($coach); $coach->addCour($this); } return $this; } public function removeCoach(Coach $coach): self { if ($this->coaches->removeElement($coach)) { $coach->removeCour($this); } return $this; } public function getAccroche(): ?string { return $this->accroche; } public function setAccroche(string $accroche): self { $this->accroche = $accroche; return $this; }}