<?php

namespace AppBundle\Entity\Organization;

use AppBundle\Entity\AccessAndFunction\Access;
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;

/**
 * Licence possédée par une Organization
 *
 * @Iri("http://schema.org/OrganizationLicence")
 */
#[ORM\Entity]
class OrganizationLicence
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['organizationlicence', 'organization_details'])]
    private $id;
    /**
     * @var Organization
     */
    #[ORM\ManyToOne(targetEntity: 'Organization', inversedBy: 'organizationLicences')]
    #[ORM\JoinColumn(name: 'organization_id', referencedColumnName: 'id', nullable: false)]
    #[Assert\NotNull]
    #[Groups(['organizationlicence'])]
    private $organization;
    /**
     * @var Access
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'organizationLicences')]
    #[ORM\JoinColumn(nullable: false)]
    #[Assert\NotNull]
    #[Groups(['organizationlicence', 'organization_details_organizationlicences'])]
    private $licensee;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['organizationlicence', 'organization_details_organizationlicences'])]
    private $licenceNumber;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['organizationlicence', 'organization_details_organizationlicences'])]
    private $categorie;
    /**
     * @var \DateTime
     */
    #[ORM\Column(type: 'date', nullable: true)]
    #[Assert\Date]
    #[Groups(['organizationlicence', 'organization_details_organizationlicences'])]
    private $validityDate;
    /**
     * 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 Organization.
     *
     * @param Organization $organization
     *
     * @return $this
     */
    public function setOrganization(Organization $organization = null)
    {
        $this->organization = $organization;

        return $this;
    }
    /**
     * Gets organization.
     *
     * @return Organization
     */
    public function getOrganization()
    {
        return $this->organization;
    }
    /**
     * Sets Access.
     *
     * @param Access $licensee
     *
     * @return $this
     */
    public function setLicensee(Access $licensee = null)
    {
        $this->licensee = $licensee;

        return $this;
    }
    /**
     * Gets licensee.
     *
     * @return Access
     */
    public function getLicensee()
    {
        return $this->licensee;
    }
    /**
     * Sets licenceNumber.
     *
     * @param string $licenceNumber
     *
     * @return $this
     */
    public function setLicenceNumber($licenceNumber)
    {
        $this->licenceNumber = $licenceNumber;

        return $this;
    }
    /**
     * Gets licenceNumber.
     *
     * @return string
     */
    public function getLicenceNumber()
    {
        return $this->licenceNumber;
    }
    /**
     * Sets categorie.
     *
     * @param string $categorie
     *
     * @return $this
     */
    public function setCategorie($categorie)
    {
        $this->categorie = $categorie;

        return $this;
    }
    /**
     * Gets categorie.
     *
     * @return string
     */
    public function getCategorie()
    {
        return $this->categorie;
    }
    /**
     * Sets validityDate.
     *
     * @param \DateTime $validityDate
     *
     * @return $this
     */
    public function setValidityDate(\DateTime $validityDate = null)
    {
        $this->validityDate = $validityDate;

        return $this;
    }
    /**
     * Gets validityDate.
     *
     * @return \DateTime
     */
    public function getValidityDate()
    {
        return $this->validityDate;
    }
}
