<?php

namespace AppBundle\Entity\AccessWish;

use AppBundle\Annotation\ExportTranslate;
use AppBundle\Entity\Education\Education;
use AppBundle\Entity\Education\EducationCurriculum;
use AppBundle\Entity\Education\EducationStudent;
use AppBundle\Entity\Education\EducationTiming;
use AppBundle\Enum\OnlineRegistration\EducationStudentWishOriginEnum;
use Doctrine\ORM\Mapping as ORM;
use Dunglas\ApiBundle\Annotation\Iri;
use Finite\StatefulInterface;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use AppBundle\Entity\Traits\TimestampableEntity;
use AppBundle\Entity\Traits\CreatorUpdaterEntity;

/**
 * EducationStudentWish.
 *
 * @see http://schema.org/EducationStudentWish Documentation on Schema.org
 *
 * @Iri("http://schema.org/EducationStudentWish")
 */
#[ORM\Entity(repositoryClass: 'AppBundle\Entity\AccessWish\Repository\EducationStudentWishRepository')]
class EducationStudentWish
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['educationstudentwish', 'online_registration', 'education_student_wish_list', 'online_registration_validation_access_family', 'online_registration_validation'])]
    private $id;
    /**
     * @var Education
     *
     *
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Education\Education')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    #[Groups(['educationstudentwish', 'online_registration_educationstudentwishes', 'online_registration_educationstudentreregistrationswishes', 'education_student_wish_list', 'online_registration_validation_educationstudentwishes', 'online_registration_validation_educationstudentreregistrationswishes'])]
    private $educationWish;
    /**
     * @var array
     */
    #[ORM\Column(type: 'json_array', nullable: true)]
    #[Groups(['educationstudentwish', 'online_registration_educationstudentwishes', 'online_registration_educationstudentreregistrationswishes', 'online_registration_validation_educationstudentwishes', 'online_registration_validation_educationstudentreregistrationswishes'])]
    private $days;
    /**
     * @var \DateTime
     */
    #[ORM\Column(type: 'time', nullable: true)]
    #[Assert\Time]
    #[Groups(['educationstudentwish', 'online_registration_educationstudentwishes', 'online_registration_educationstudentreregistrationswishes', 'online_registration_validation_educationstudentwishes', 'online_registration_validation_educationstudentreregistrationswishes'])]
    private $time;
    /**
     * @var AccessWish
     *
     *
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessWish\AccessWish', inversedBy: 'educationStudentWishes')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    #[Groups(['educationstudentwish', 'education_student_wish_list', 'online_registration_validation_access_family'])]
    private $accessWish;
    /**
     * @var AccessWish
     *
     *
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessWish\AccessWish', inversedBy: 'educationStudentReregistrationsWishes')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    #[Groups(['educationstudentwish', 'education_student_wish_list', 'online_registration_validation_access_family'])]
    private $accessWishReregistrations;
    private $accessSearch;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['educationstudentwish', 'online_registration_educationstudentwishes', 'online_registration_validation_educationstudentwishes'])]
    private $registeredFollowingYear = false;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', options: ['default' => 'NO_INFORMATION'])]
    #[Assert\Type(type: 'string')]
    #[Assert\NotNull]
    #[Assert\Choice(callback: ['\AppBundle\Enum\OnlineRegistration\WishRegistration', 'toArray'])]
    #[Groups(['education_student_wish_list', 'online_registration_validation_educationstudentwishes', 'online_registration_validation_educationstudentreregistrationswishes', 'online_registration_educationstudentreregistrationswishes'])]
    private $wishRegistration = "NO_INFORMATION";
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', options: ['default' => 'NEGOTIABLE'])]
    #[Assert\Type(type: 'string')]
    #[Assert\NotNull]
    #[Assert\Choice(callback: ['\AppBundle\Enum\OnlineRegistration\RegistrationStatus', 'toArray'])]
    #[Groups(['education_student_wish_list', 'online_registration_validation_educationstudentwishes', 'online_registration_validation_educationstudentreregistrationswishes'])]
    private $registrationStatus = "NEGOTIABLE";
    /**
     * @var string
     * @ExportTranslate(true)
     */
    #[Assert\Type(type: 'string')]
    #[Groups(['education_student_wish_list'])]
    private $origin;
    /**
     * @var EducationCurriculum
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Education\EducationCurriculum')]
    #[Groups(['educationstudentwish_educationcurriculum', 'online_registration_validation_educationstudentwishes'])]
    private $educationCurriculum;
    /**
     * @var EducationStudent
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Education\EducationStudent')]
    #[Groups(['educationstudentwish', 'online_registration_educationstudentwishes', 'online_registration_educationstudentreregistrationswishes', 'online_registration_validation_educationstudentwishes', 'online_registration_validation_educationstudentreregistrationswishes'])]
    private $educationStudent;
    /**
     * @var EducationTiming
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Education\EducationTiming')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    #[Groups(['educationstudentwish', 'online_registration_educationstudentwishes', 'online_registration_educationstudentreregistrationswishes', 'online_registration_validation_educationstudentwishes', 'online_registration_validation_educationstudentreregistrationswishes'])]
    private $educationTiming;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['educationstudentwish'])]
    private $alreadyValidate = false;
    /**
     * Constructor
     */
    public function __construct()
    {

    }
    /**
     * Sets id.
     *
     * @param int $id
     *
     * @return $this
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }
    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }
    /**
     * Set days
     *
     * @param array $days
     *
     * @return EducationStudentWish
     */
    public function setDays($days)
    {
        $this->days = $days;

        return $this;
    }
    /**
     * Get days
     *
     * @return array
     */
    public function getDays()
    {
        return $this->days;
    }
    /**
     * Set accessWish
     *
     * @param \AppBundle\Entity\AccessWish\AccessWish $accessWish
     *
     * @return EducationStudentWish
     */
    public function setAccessWish(\AppBundle\Entity\AccessWish\AccessWish $accessWish = null)
    {
        $this->accessWish = $accessWish;

        return $this;
    }
    /**
     * Get accessWish
     *
     * @return \AppBundle\Entity\AccessWish\AccessWish
     */
    public function getAccessWish()
    {
        return $this->accessWish;
    }
    /**
     * Set registeredFollowingYear
     *
     * @param boolean $registeredFollowingYear
     *
     * @return EducationStudentWish
     */
    public function setRegisteredFollowingYear($registeredFollowingYear)
    {
        $this->registeredFollowingYear = $registeredFollowingYear;

        return $this;
    }
    /**
     * Get registeredFollowingYear
     *
     * @return boolean
     */
    public function getRegisteredFollowingYear()
    {
        return $this->registeredFollowingYear;
    }
    /**
     * Set time
     *
     * @param \DateTime $time
     *
     * @return EducationStudentWish
     */
    public function setTime($time)
    {
        $this->time = $time;

        return $this;
    }
    /**
     * Get time
     *
     * @return \DateTime
     */
    public function getTime()
    {
        return $this->time ? $this->time->format('H:i') : $this->time;
    }
    public function getTimeDateTime()
    {
        return $this->time;
    }
    /**
     * Set registrationStatus
     *
     * @param string $registrationStatus
     *
     * @return EducationStudentWish
     */
    public function setRegistrationStatus($registrationStatus)
    {
        $this->registrationStatus = $registrationStatus;

        return $this;
    }
    /**
     * Get registrationStatus
     *
     * @return string
     */
    public function getRegistrationStatus()
    {
        return $this->registrationStatus;
    }
    /**
     * Set wishRegistration
     *
     * @param string $wishRegistration
     *
     * @return EducationStudentWish
     */
    public function setWishRegistration($wishRegistration)
    {
        $this->wishRegistration = $wishRegistration;

        return $this;
    }
    /**
     * Get wishRegistration
     *
     * @return string
     */
    public function getWishRegistration()
    {
        return $this->wishRegistration;
    }
    /**
     * Set accessWishReregistrations
     *
     * @param \AppBundle\Entity\AccessWish\AccessWish $accessWishReregistrations
     *
     * @return EducationStudentWish
     */
    public function setAccessWishReregistrations(\AppBundle\Entity\AccessWish\AccessWish $accessWishReregistrations = null)
    {
        $this->accessWishReregistrations = $accessWishReregistrations;

        return $this;
    }
    /**
     * Get accessWishReregistrations
     *
     * @return \AppBundle\Entity\AccessWish\AccessWish
     */
    public function getAccessWishReregistrations()
    {
        return $this->accessWishReregistrations;
    }
    /**
     * Set educationWish
     *
     * @param \AppBundle\Entity\Education\Education $educationWish
     *
     * @return EducationStudentWish
     */
    public function setEducationWish(\AppBundle\Entity\Education\Education $educationWish = null)
    {
        $this->educationWish = $educationWish;

        return $this;
    }
    /**
     * Get educationWish
     *
     * @return \AppBundle\Entity\Education\Education
     */
    public function getEducationWish()
    {
        return $this->educationWish;
    }
    public function getAccessSearch(){
        return $this->getAccessWish() ? $this->getAccessWish() : $this->getAccessWishReregistrations();
    }
    /**
     * @return mixed
     * @throws \Exception
     */
    public function getOrigin()
    {
        if(!empty($this->getAccessWishReregistrations())){
            return EducationStudentWishOriginEnum::REREGISTRATION;
        }else{
            return EducationStudentWishOriginEnum::NEW_REGISTRATION;
        }
    }
    /**
     * Set alreadyValidate
     *
     * @param boolean $alreadyValidate
     *
     * @return EducationStudentWish
     */
    public function setAlreadyValidate($alreadyValidate)
    {
        $this->alreadyValidate = $alreadyValidate;

        return $this;
    }
    /**
     * Get alreadyValidate
     *
     * @return boolean
     */
    public function getAlreadyValidate()
    {
        return $this->alreadyValidate;
    }
    /**
     * Set educationCurriculum
     *
     * @param \AppBundle\Entity\Education\EducationCurriculum $educationCurriculum
     *
     * @return EducationStudentWish
     */
    public function setEducationCurriculum(\AppBundle\Entity\Education\EducationCurriculum $educationCurriculum = null)
    {
        $this->educationCurriculum = $educationCurriculum;

        return $this;
    }
    /**
     * Get educationCurriculum
     *
     * @return \AppBundle\Entity\Education\EducationCurriculum
     */
    public function getEducationCurriculum()
    {
        return $this->educationCurriculum;
    }
    /**
     * Set educationTiming
     *
     * @param \AppBundle\Entity\Education\EducationTiming $educationTiming
     *
     * @return EducationStudentWish
     */
    public function setEducationTiming(\AppBundle\Entity\Education\EducationTiming $educationTiming = null)
    {
        $this->educationTiming = $educationTiming;

        return $this;
    }
    /**
     * Get educationTiming
     *
     * @return \AppBundle\Entity\Education\EducationTiming
     */
    public function getEducationTiming()
    {
        return $this->educationTiming;
    }
    /**
     * Set educationStudent
     *
     * @param \AppBundle\Entity\Education\EducationStudent $educationStudent
     *
     * @return EducationStudentWish
     */
    public function setEducationStudent(\AppBundle\Entity\Education\EducationStudent $educationStudent = null)
    {
        $this->educationStudent = $educationStudent;

        return $this;
    }
    /**
     * Get educationStudent
     *
     * @return \AppBundle\Entity\Education\EducationStudent
     */
    public function getEducationStudent()
    {
        return $this->educationStudent;
    }
}
