<?php

namespace AppBundle\Entity\Person;

use AppBundle\Entity\AccessAndFunction\Access;
use AppBundle\Entity\Traits\ActivityPeriodTrait;
use Doctrine\ORM\Mapping as ORM;
use Dunglas\ApiBundle\Annotation\Iri;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use AppBundle\Entity\Traits\TimestampableEntity;
use AppBundle\Entity\Traits\CreatorUpdaterEntity;

/**
 * Membre d'une commission, fais le lien entre un Access et une Commission
 *
 * @Iri("http://schema.org/CommissionMember")
 */
#[ORM\Entity]
class CommissionMember
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    use ActivityPeriodTrait;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['commissionmember', 'commission_list'])]
    private $id;
    /**
     * @var Commission
     */
    #[ORM\ManyToOne(targetEntity: 'Commission', inversedBy: 'commissionMembers')]
    #[ORM\JoinColumn(nullable: false)]
    #[Assert\NotNull]
    #[Groups(['commissionmember'])]
    private $commission;
    /**
     * @var Access
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'commissionMembers')]
    #[ORM\JoinColumn(nullable: false)]
    #[Assert\NotNull]
    #[Groups(['commissionmember', 'commission_list_commissionmembers'])]
    private $member;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Assert\Choice(callback: ['AppBundle\Enum\Person\CommissionMemberFunctionEnum', 'toArray'])]
    #[Groups(['commissionmember', 'commission_list_commissionmembers'])]
    private $commissionMemberFunction;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 30, nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['commissionmember', 'commission_list_commissionmembers'])]
    private $functionComplement;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Assert\Choice(callback: ['AppBundle\Enum\Person\CauseOutputEnum', 'toArray'])]
    #[Groups(['commissionmember', 'commission_list_commissionmembers'])]
    private $causeOutput;
    /**
     * Constructor
     */
    public function __construct()
    {
    }
    /**
     * Sets id.
     * 
     * @param int $id
     * 
     * @return $this
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }
    /**
     * Gets id.
     * 
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }
    /**
     * Sets commission.
     * 
     * @param Commission $commission
     * 
     * @return $this
     */
    public function setCommission(Commission $commission)
    {
        $this->commission = $commission;

        return $this;
    }
    /**
     * Gets commission.
     * 
     * @return Commission
     */
    public function getCommission()
    {
        return $this->commission;
    }
    /**
     * Sets member.
     * 
     * @param Access $member
     * 
     * @return $this
     */
    public function setMember(Access $member)
    {
        $this->member = $member;

        return $this;
    }
    /**
     * Gets member.
     * 
     * @return Access
     */
    public function getMember()
    {
        return $this->member;
    }
    /**
     * Sets commissionMemberFunction.
     * 
     * @param string $commissionMemberFunction
     * 
     * @return $this
     */
    public function setCommissionMemberFunction($commissionMemberFunction)
    {
        $this->commissionMemberFunction = $commissionMemberFunction;

        return $this;
    }
    /**
     * Gets commissionMemberFunction.
     * 
     * @return string
     */
    public function getCommissionMemberFunction()
    {
        return $this->commissionMemberFunction;
    }
    /**
     * Sets functionComplement.
     * 
     * @param string $functionComplement
     * 
     * @return $this
     */
    public function setFunctionComplement($functionComplement)
    {
        $this->functionComplement = $functionComplement;

        return $this;
    }
    /**
     * Gets functionComplement.
     * 
     * @return string
     */
    public function getFunctionComplement()
    {
        return $this->functionComplement;
    }
    /**
     * Sets causeOutput.
     * 
     * @param string $causeOutput
     * 
     * @return $this
     */
    public function setCauseOutput($causeOutput)
    {
        $this->causeOutput = $causeOutput;

        return $this;
    }
    /**
     * Gets causeOutput.
     * 
     * @return string
     */
    public function getCauseOutput()
    {
        return $this->causeOutput;
    }
}
