<?php

namespace App\Entity;

use App\Repository\ServiceRdvReservationRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

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

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

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

    #[ORM\ManyToOne(inversedBy: 'serviceRdvReservations')]
    #[ORM\JoinColumn(nullable: false)]
    private ?ServiceRdv $serviceRdv = null;

    #[ORM\ManyToOne(inversedBy: 'serviceRdvReservations')]
    #[ORM\JoinColumn(nullable: false)]
    private ?Service $service = null;

    #[ORM\Column]
    private ?bool $disponible = null;

    #[ORM\OneToOne(mappedBy: 'serviceRdvReservation', cascade: ['persist', 'remove'])]
    private ?ReservationService $reservationService = null;

    public function __construct()
    {
        $this->disponible = true;
    }

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

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

    public function setDateDebut(\DateTimeInterface $dateDebut): static
    {
        $this->dateDebut = $dateDebut;

        return $this;
    }

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

    public function setDateFin(\DateTimeInterface $dateFin): static
    {
        $this->dateFin = $dateFin;

        return $this;
    }

    public function getServiceRdv(): ?ServiceRdv
    {
        return $this->serviceRdv;
    }

    public function setServiceRdv(?ServiceRdv $serviceRdv): static
    {
        $this->serviceRdv = $serviceRdv;

        return $this;
    }

    public function getService(): ?Service
    {
        return $this->service;
    }

    public function setService(?Service $service): static
    {
        $this->service = $service;

        return $this;
    }

    public function isDisponible(): ?bool
    {
        return $this->disponible;
    }

    public function setDisponible(bool $disponible): static
    {
        $this->disponible = $disponible;

        return $this;
    }

    public function getReservationService(): ?ReservationService
    {
        return $this->reservationService;
    }

    public function setReservationService(ReservationService $reservationService): static
    {
        // set the owning side of the relation if necessary
        if ($reservationService->getServiceRdvReservation() !== $this) {
            $reservationService->setServiceRdvReservation($this);
        }

        $this->reservationService = $reservationService;

        return $this;
    }
}
