src/Entity/Playlist.php line 13
<?phpnamespace App\Entity;use App\Repository\PlaylistRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: PlaylistRepository::class)]class Playlist{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[Assert\Length(min: 2,max: 255,minMessage: 'Your titre must be at least {{ limit }} characters long',maxMessage: 'Your titre cannot be longer than {{ limit }} characters',)]#[ORM\Column(length: 255)]private ?string $titre = null;#[ORM\Column(type: Types::TEXT)]private ?string $description = null;#[ORM\Column(length: 255, nullable: true)]private ?string $image_de_couverture = null;#[ORM\Column(nullable: true)]private ?bool $publish = null;#[ORM\Column(nullable: true)]private ?int $prix = null;#[ORM\OneToMany(mappedBy: 'playlist', targetEntity: Contient::class)]private Collection $contient;#[ORM\OneToMany(mappedBy: 'playlist', targetEntity: UsersPlayslist::class)]private Collection $usersPlayslists;#[ORM\OneToMany(mappedBy: 'Playlist', targetEntity: PurchaceOrders::class)]private Collection $purchaceOrders;#[ORM\OneToMany(mappedBy: 'playlist', targetEntity: Afile::class)]private Collection $fichiers;#[ORM\ManyToMany(targetEntity: Instructor::class, inversedBy: 'playlists')]private Collection $instructors;#[ORM\ManyToOne(inversedBy: 'playlists')]private ?Category $category = null;public function __construct(){$this->contient = new ArrayCollection();$this->usersPlayslists = new ArrayCollection();$this->purchaceOrders = new ArrayCollection();$this->fichiers = new ArrayCollection();$this->instructors = new ArrayCollection();}public function __toString(){return $this->titre;}public function getId(): ?int{return $this->id;}public function getTitre(): ?string{return $this->titre;}public function setTitre(string $titre): self{$this->titre = $titre;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(string $description): self{$this->description = $description;return $this;}public function getImageDeCouverture(): ?string{return $this->image_de_couverture;}public function setImageDeCouverture(?string $image_de_couverture): self{$this->image_de_couverture = $image_de_couverture;return $this;}public function isPublish(): ?bool{return $this->publish;}public function setPublish(?bool $publish): self{$this->publish = $publish;return $this;}public function getPrix(): ?int{return $this->prix;}public function setPrix(?int $prix): self{$this->prix = $prix;return $this;}/*** @return Collection<int, Contient>*/public function getContient(): Collection{return $this->contient;}public function addContient(Contient $contient): self{if (!$this->contient->contains($contient)) {$this->contient->add($contient);$contient->setPlaylist($this);}return $this;}public function removeContient(Contient $contient): self{if ($this->contient->removeElement($contient)) {// set the owning side to null (unless already changed)if ($contient->getPlaylist() === $this) {$contient->setPlaylist(null);}}return $this;}/*** @return Collection<int, UsersPlayslist>*/public function getUsersPlayslists(): Collection{return $this->usersPlayslists;}public function addUsersPlayslist(UsersPlayslist $usersPlayslist): self{if (!$this->usersPlayslists->contains($usersPlayslist)) {$this->usersPlayslists->add($usersPlayslist);$usersPlayslist->setPlaylist($this);}return $this;}public function removeUsersPlayslist(UsersPlayslist $usersPlayslist): self{if ($this->usersPlayslists->removeElement($usersPlayslist)) {// set the owning side to null (unless already changed)if ($usersPlayslist->getPlaylist() === $this) {$usersPlayslist->setPlaylist(null);}}return $this;}/*** @return Collection<int, PurchaceOrders>*/public function getPurchaceOrders(): Collection{return $this->purchaceOrders;}public function addPurchaceOrder(PurchaceOrders $purchaceOrder): self{if (!$this->purchaceOrders->contains($purchaceOrder)) {$this->purchaceOrders->add($purchaceOrder);$purchaceOrder->setPlaylist($this);}return $this;}public function removePurchaceOrder(PurchaceOrders $purchaceOrder): self{if ($this->purchaceOrders->removeElement($purchaceOrder)) {// set the owning side to null (unless already changed)if ($purchaceOrder->getPlaylist() === $this) {$purchaceOrder->setPlaylist(null);}}return $this;}/*** @return Collection<int, Afile>*/public function getFichiers(): Collection{return $this->fichiers;}public function addFichier(Afile $fichier): self{if (!$this->fichiers->contains($fichier)) {$this->fichiers->add($fichier);$fichier->setPlaylist($this);}return $this;}public function removeFichier(Afile $fichier): self{if ($this->fichiers->removeElement($fichier)) {// set the owning side to null (unless already changed)if ($fichier->getPlaylist() === $this) {$fichier->setPlaylist(null);}}return $this;}/*** @return Collection<int, Instructor>*/public function getInstructors(): Collection{return $this->instructors;}public function addInstructor(Instructor $instructor): self{if (!$this->instructors->contains($instructor)) {$this->instructors->add($instructor);$instructor->addPlaylist($this);}return $this;}public function removeInstructor(Instructor $instructor): self{if ($this->instructors->removeElement($instructor)) {$instructor->removePlaylist($this);}return $this;}public function getCategory(): ?Category{return $this->category;}public function setCategory(?Category $category): self{$this->category = $category;return $this;}}