<?php
declare (strict_types=1);

namespace App\Entity\Person;

use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\ApiResource;
use App\Entity\Access\Access;

//use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
use Doctrine\ORM\Mapping as ORM;

/**
 * Classe ... qui ...
 */
#[ApiResource(
    operations: [
        new Get(
            security: 'is_granted(\'ROLE_ADMIN\')'
        )
    ]
)]
//#[Auditable]
#[ORM\Entity]
class CommissionMember
{
    #[ORM\Id]
    #[ORM\Column]
    #[ORM\GeneratedValue]
    private ?int $id = null;

    #[ORM\ManyToOne(inversedBy: 'commissionMembers')]
    #[ORM\JoinColumn(nullable: false)]
    private Commission $commission;

    #[ORM\ManyToOne(inversedBy: 'commissionMembers')]
    #[ORM\JoinColumn(nullable: false)]
    private Access $member;

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

    public function getCommission(): ?Commission
    {
        return $this->commission;
    }

    public function setCommission(?Commission $commission): self
    {
        $this->commission = $commission;
        return $this;
    }

    public function getMember(): ?Access
    {
        return $this->member;
    }

    public function setMember(?Access $member): self
    {
        $this->member = $member;
        return $this;
    }
}
