<?php

namespace AppBundle\Entity\Booking;

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;

/**
 * Type de public d'une prestation pédagogique EducationnalProject
 *
 * @Iri("http://schema.org/EducationalProjectPublic")
 */
#[ORM\Entity]
class EducationalProjectPublic
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['educationalprojectpublic', 'educationalproject_details'])]
    private $id;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 255, nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Assert\Choice(callback: ['\AppBundle\Enum\Booking\EducationalProjectPublicFamillyEnum', 'toArray'])]
    #[Groups(['educationalprojectpublic'])]
    private $familly;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 255)]
    #[Assert\Type(type: 'string')]
    #[Assert\NotNull]
    #[Assert\Choice(callback: ['\AppBundle\Enum\Booking\EducationalProjectPublicFamillyEnum', 'toArray'])]
    #[Groups(['educationalprojectpublic', 'educationalproject_details_public'])]
    private $subFamilly;
    /**
     * @var ArrayCollection<EducationalProject>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\EducationalProject', mappedBy: 'public')]
    #[Groups(['educationalprojectpublic_educationalproject'])]
    private $educationalProjects;
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->educationalProjects = 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;
    }
    /**
     * Sets familly.
     * 
     * @param string $familly
     * 
     * @return $this
     */
    public function setFamilly($familly)
    {
        $this->familly = $familly;

        return $this;
    }
    /**
     * Gets familly.
     * 
     * @return string
     */
    public function getFamilly()
    {
        return $this->familly;
    }
    /**
     * Sets subFamilly.
     * 
     * @param string $subFamilly
     * 
     * @return $this
     */
    public function setSubFamilly($subFamilly)
    {
        $this->subFamilly = $subFamilly;

        return $this;
    }
    /**
     * Gets subFamilly.
     * 
     * @return string
     */
    public function getSubFamilly()
    {
        return $this->subFamilly;
    }
    /**
     * Add educationalProject
     *
     * @param \AppBundle\Entity\Booking\EducationalProject $educationalProject
     *
     * @return EducationalProjectPublic
     */
    public function addEducationalProject(\AppBundle\Entity\Booking\EducationalProject $educationalProject)
    {
        $this->educationalProjects[] = $educationalProject;

        return $this;
    }
    /**
     * Remove educationalProject
     *
     * @param \AppBundle\Entity\Booking\EducationalProject $educationalProject
     */
    public function removeEducationalProject(\AppBundle\Entity\Booking\EducationalProject $educationalProject)
    {
        $this->educationalProjects->removeElement($educationalProject);
    }
    /**
     * Get educationalProjects
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEducationalProjects()
    {
        return $this->educationalProjects;
    }
}
