<?php

namespace AppBundle\Entity\Education;

use AppBundle\Entity\AccessAndFunction\Access;
use Doctrine\Common\Collections\ArrayCollection;
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;

/**
 * Fait le lien entre un Access (professeur) et un Education (enseignement)
 *
 * @Iri("http://schema.org/educationteacher")
 */
#[ORM\Entity]
class EducationTeacher
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['educationteacher'])]
    private $id;
    /**
     * @var string
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Education\Education', inversedBy: 'educationTeachers')]
    #[ORM\JoinColumn(onDelete: 'CASCADE')]
    #[Assert\NotNull]
    #[Groups(['educationteacher'])]
    private $education;
    /**
     * @var Access
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'educationTeachers')]
    #[Assert\NotNull]
    #[Groups(['educationteacher', 'educationteacher_reference'])]
    private $teacher;
    /**
     * @var ArrayCollection<SeizurePeriodNotation>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Education\SeizurePeriodNotation', mappedBy: 'educationTeacher', orphanRemoval: true, cascade: ['persist', 'remove'])]
    #[Groups(['educationstudent_seizureperiodnotation'])]
    private $seizurePeriodNotations;
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->seizurePeriodNotations = new ArrayCollection();
    }
    /**
     * 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;
    }
    /**
     * Set education
     *
     * @param \AppBundle\Entity\Education\Education $education
     *
     * @return EducationTeacher
     */
    public function setEducation(\AppBundle\Entity\Education\Education $education = null)
    {
        $this->education = $education;

        return $this;
    }
    /**
     * Get education
     *
     * @return \AppBundle\Entity\Education\Education
     */
    public function getEducation()
    {
        return $this->education;
    }
    /**
     * Set teacher
     *
     * @param \AppBundle\Entity\AccessAndFunction\Access $teacher
     *
     * @return EducationTeacher
     */
    public function setTeacher(\AppBundle\Entity\AccessAndFunction\Access $teacher = null)
    {
        $this->teacher = $teacher;

        return $this;
    }
    /**
     * Get teacher
     *
     * @return \AppBundle\Entity\AccessAndFunction\Access
     */
    public function getTeacher()
    {
        return $this->teacher;
    }
    /**
     * Add seizurePeriodNotation
     *
     * @param \AppBundle\Entity\Education\SeizurePeriodNotation $seizurePeriodNotation
     *
     * @return EducationTeacher
     */
    public function addSeizurePeriodNotation(\AppBundle\Entity\Education\SeizurePeriodNotation $seizurePeriodNotation)
    {
        $seizurePeriodNotation->setEducationTeacher($this);
        $this->seizurePeriodNotations[] = $seizurePeriodNotation;

        return $this;
    }
    /**
     * Remove seizurePeriodNotation
     *
     * @param \AppBundle\Entity\Education\SeizurePeriodNotation $seizurePeriodNotation
     */
    public function removeSeizurePeriodNotation(\AppBundle\Entity\Education\SeizurePeriodNotation $seizurePeriodNotation)
    {
        $this->seizurePeriodNotations->removeElement($seizurePeriodNotation);
    }
    /**
     * Get seizurePeriodNotations
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getSeizurePeriodNotations()
    {
        return $this->seizurePeriodNotations;
    }
}
