<?php
declare (strict_types=1);

namespace App\Entity\Person;

use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Post;
use ApiPlatform\Metadata\Delete;
use ApiPlatform\Metadata\Patch;
use ApiPlatform\Metadata\Put;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiFilter;
use App\Entity\Access\Access;
use App\Entity\Organization\Activity;
use App\Entity\Product\EquipmentList;
use App\Entity\Traits\ActivityPeriodTrait;
use App\Repository\Person\PersonActivityRepository;
//use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
use Doctrine\ORM\Mapping as ORM;
/**
 * Lien entre une Person et une Activity
 */
#[ApiResource]
//#[Auditable]
#[ORM\Entity(repositoryClass: PersonActivityRepository::class)]
class PersonActivity
{
    use ActivityPeriodTrait;
    #[ORM\Id]
    #[ORM\Column]
    #[ORM\GeneratedValue]
    private ?int $id = null;
    #[ORM\Column(length: 255, nullable: true)]
    private ?string $complementSpeciality = null;
    #[ORM\ManyToOne(inversedBy: 'personActivity')]
    #[ORM\JoinColumn(nullable: false)]
    private ?Access $access = null;
    #[ORM\ManyToOne(inversedBy: 'personActivities')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    private Activity $activity;
    #[ORM\ManyToOne]
    private EquipmentList $speciality;
    public function getId() : ?int
    {
        return $this->id;
    }
    public function getComplementSpeciality() : ?string
    {
        return $this->complementSpeciality;
    }
    public function setComplementSpeciality(?string $complementSpeciality) : self
    {
        $this->complementSpeciality = $complementSpeciality;
        return $this;
    }
    public function getAccess() : ?Access
    {
        return $this->access;
    }
    public function setAccess(?Access $access) : self
    {
        $this->access = $access;
        return $this;
    }
    public function getActivity() : ?Activity
    {
        return $this->activity;
    }
    public function setActivity(?Activity $activity) : self
    {
        $this->activity = $activity;
        return $this;
    }
    public function getSpeciality() : ?EquipmentList
    {
        return $this->speciality;
    }
    public function setSpeciality(?EquipmentList $speciality) : self
    {
        $this->speciality = $speciality;
        return $this;
    }
}
