<?php
declare(strict_types=1);

namespace App\Entity\Place;

use App\Entity\Access\Access;
//use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Core\AbstractRepair;

/**
 * @todo : A la suite de la migration, il faut supprimer le nom de la table pour avoir une table RoomRepair, et supprimer l'attribut discr.
 *
 * Classe ... qui ...
 */
//#[Auditable]
#[ORM\Entity]
#[ORM\Table(name: 'Repair')]
class RoomRepair extends AbstractRepair
{
    #[ORM\Column(length: 255, nullable: false)]
    private string $discr = 'room';

    #[ORM\ManyToOne(inversedBy: 'repairs')]
    private Room $room;

    #[ORM\ManyToOne(inversedBy: 'roomRepairProviders')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    private Access $provider;

    public function getDiscr(): ?string
    {
        return $this->discr;
    }

    public function setDiscr(string $discr): self
    {
        $this->discr = $discr;

        return $this;
    }

    public function getRoom(): ?Room
    {
        return $this->room;
    }

    public function setRoom(?Room $room): self
    {
        $this->room = $room;

        return $this;
    }

    public function getProvider(): ?Access
    {
        return $this->provider;
    }

    public function setProvider(?Access $provider): self
    {
        $this->provider = $provider;

        return $this;
    }
}