<?php

declare(strict_types=1);

namespace App\Entity\Product;

use ApiPlatform\Metadata\ApiResource;
use App\Entity\Access\Access;
use App\Entity\Core\AbstractControl;
// use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
 * @todo : A la suite de la migration, il faut supprimer le nom de la table pour avoir une table EquipmentControl, et supprimer l'attribut discr.
 *
 * Contrôle du bon état des Equipment
 */
// #[Auditable]
#[ApiResource(operations: [])]
#[ORM\Entity]
class EquipmentControl extends AbstractControl
{
    #[ORM\ManyToOne(inversedBy: 'accompanistControl')]
    #[ORM\JoinColumn(nullable: true)]
    protected ?Access $accompanist = null;

    #[ORM\ManyToOne(inversedBy: 'equipmentControl')]
    protected ?Equipment $equipment = null;

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

    public function getEquipment(): ?Equipment
    {
        return $this->equipment;
    }

    public function setEquipment(?Equipment $equipment): self
    {
        $this->equipment = $equipment;

        return $this;
    }

    public function getAccompanist(): Access
    {
        return $this->accompanist;
    }

    public function setAccompanist(Access $accompanist): self
    {
        $this->accompanist = $accompanist;

        return $this;
    }
}
