<?php

namespace App\Entity;

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

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

    #[ORM\Column(type: Types::DATE_MUTABLE)]
    private ?\DateTimeInterface $date_dispo = null;

    #[ORM\Column(type: Types::TIME_MUTABLE)]
    private ?\DateTimeInterface $heure = null;

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

    #[ORM\ManyToOne(inversedBy: 'disponibiliteAteliers')]
    private ?Atelier $atelier = null;

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

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

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

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

    public function getDateDispo(): ?\DateTimeInterface
    {
        return $this->date_dispo;
    }

    public function setDateDispo(\DateTimeInterface $date_dispo): static
    {
        $this->date_dispo = $date_dispo;

        return $this;
    }

    public function getHeure(): ?\DateTimeInterface
    {
        return $this->heure;
    }

    public function setHeure(\DateTimeInterface $heure): static
    {
        $this->heure = $heure;

        return $this;
    }

    public function getLieux(): ?string
    {
        return $this->lieux;
    }

    public function setLieux(string $lieux): static
    {
        $this->lieux = $lieux;

        return $this;
    }

    public function getAtelier(): ?Atelier
    {
        return $this->atelier;
    }

    public function setAtelier(?Atelier $atelier): static
    {
        $this->atelier = $atelier;

        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->setDisponibiliteAtelier($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->getDisponibiliteAtelier() === $this) {
                $quiParticipe->setDisponibiliteAtelier(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->setDispoAtelier($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->getDispoAtelier() === $this) {
                $quiOrganise->setDispoAtelier(null);
            }
        }

        return $this;
    }
}
