<?php

namespace App\Entity;

use App\Repository\AtelierRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: AtelierRepository::class)]
class Atelier
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\Column(length: 255)]
    private ?string $nom = null;

    #[ORM\Column(type: Types::TEXT)]
    private ?string $description = null;

    #[ORM\Column]
    private ?float $prix = null;

    #[ORM\Column]
    private ?int $temps = null;

    /**
     * @var Collection<int, DisponibiliteAtelier>
     */
    #[ORM\OneToMany(targetEntity: DisponibiliteAtelier::class, mappedBy: 'atelier')]
    private Collection $disponibiliteAteliers;

    /**
     * @var Collection<int, QuiParticipe>
     */
    #[ORM\OneToMany(targetEntity: QuiParticipe::class, mappedBy: 'atelier')]
    private Collection $quiParticipes;

    /**
     * @var Collection<int, QuiOrganise>
     */
    #[ORM\OneToMany(targetEntity: QuiOrganise::class, mappedBy: 'atelier')]
    private Collection $quiOrganises;

    public function __construct()
    {
        $this->disponibiliteAteliers = new ArrayCollection();
        $this->quiParticipes = new ArrayCollection();
        $this->quiOrganises = new ArrayCollection();
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getNom(): ?string
    {
        return $this->nom;
    }

    public function setNom(string $nom): static
    {
        $this->nom = $nom;

        return $this;
    }

    public function getDescription(): ?string
    {
        return $this->description;
    }

    public function setDescription(string $description): static
    {
        $this->description = $description;

        return $this;
    }

    public function getPrix(): ?float
    {
        return $this->prix;
    }

    public function setPrix(float $prix): static
    {
        $this->prix = $prix;

        return $this;
    }

    public function getTemps(): ?int
    {
        return $this->temps;
    }

    public function setTemps(int $temps): static
    {
        $this->temps = $temps;

        return $this;
    }

    /**
     * @return Collection<int, DisponibiliteAtelier>
     */
    public function getDisponibiliteAteliers(): Collection
    {
        return $this->disponibiliteAteliers;
    }

    public function addDisponibiliteAtelier(DisponibiliteAtelier $disponibiliteAtelier): static
    {
        if (!$this->disponibiliteAteliers->contains($disponibiliteAtelier)) {
            $this->disponibiliteAteliers->add($disponibiliteAtelier);
            $disponibiliteAtelier->setAtelier($this);
        }

        return $this;
    }

    public function removeDisponibiliteAtelier(DisponibiliteAtelier $disponibiliteAtelier): static
    {
        if ($this->disponibiliteAteliers->removeElement($disponibiliteAtelier)) {
            // set the owning side to null (unless already changed)
            if ($disponibiliteAtelier->getAtelier() === $this) {
                $disponibiliteAtelier->setAtelier(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, QuiParticipe>
     */
    public function getQuiParticipes(): Collection
    {
        return $this->quiParticipes;
    }

    public function addQuiParticipe(QuiParticipe $quiParticipe): static
    {
        if (!$this->quiParticipes->contains($quiParticipe)) {
            $this->quiParticipes->add($quiParticipe);
            $quiParticipe->setAtelier($this);
        }

        return $this;
    }

    public function removeQuiParticipe(QuiParticipe $quiParticipe): static
    {
        if ($this->quiParticipes->removeElement($quiParticipe)) {
            // set the owning side to null (unless already changed)
            if ($quiParticipe->getAtelier() === $this) {
                $quiParticipe->setAtelier(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, QuiOrganise>
     */
    public function getQuiOrganises(): Collection
    {
        return $this->quiOrganises;
    }

    public function addQuiOrganise(QuiOrganise $quiOrganise): static
    {
        if (!$this->quiOrganises->contains($quiOrganise)) {
            $this->quiOrganises->add($quiOrganise);
            $quiOrganise->setAtelier($this);
        }

        return $this;
    }

    public function removeQuiOrganise(QuiOrganise $quiOrganise): static
    {
        if ($this->quiOrganises->removeElement($quiOrganise)) {
            // set the owning side to null (unless already changed)
            if ($quiOrganise->getAtelier() === $this) {
                $quiOrganise->setAtelier(null);
            }
        }

        return $this;
    }
}
