<?php

namespace AppBundle\Entity\AccessWish;

use AppBundle\Annotation\DefaultField;
use AppBundle\Annotation\ExportSplitFields;
use AppBundle\Entity\AccessAndFunction\Access;
use AppBundle\Entity\Core\Country;
use AppBundle\Entity\Core\File;
use AppBundle\Entity\Core\Tagg;
use AppBundle\Entity\Organization\Organization;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use DoctrineExtensions\Query\Mysql\Date;
use Dunglas\ApiBundle\Annotation\Iri;
use libphonenumber\PhoneNumberUtil;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use AppBundle\Entity\Traits\TimestampableEntity;
use AppBundle\Entity\Traits\CreatorUpdaterEntity;
use Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber as AssertPhoneNumber;
use AppBundle\Validator\Constraints as OpentalentAssert;

/**
 * Access.
 *
 * @see http://schema.org/Access Documentation on Schema.org
 *
 * @Iri("http://schema.org/AccessWish")
 */
#[ORM\Entity(repositoryClass: 'AppBundle\Entity\AccessWish\Repository\AccessWishRepository')]
class AccessWish
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['accesswish', 'education_student_wish_list', 'online_registration_access_details', 'online_registration_access_family', 'online_registration_validation_access_family', 'online_registration_validation', 'accesswish_mail'])]
    private $id;
    /**
     * @var Organization
     *
     * @DefaultField
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Organization\Organization')]
    #[ORM\JoinColumn(nullable: false)]
    #[Assert\NotNull]
    #[Groups(['accesswish'])]
    private $organization;
    /**
     * @var Access
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'accessWishes', cascade: ['persist'])]
    #[ORM\JoinColumn(onDelete: 'CASCADE')]
    #[Groups(['accesswish', 'online_registration_access_family_accesswishes', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations', 'online_registration_validation'])]
    private $accessOriginal;
    /**
     * @var AccessFamilyWish
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessWish\AccessFamilyWish', inversedBy: 'accessWishes')]
    #[Groups(['accesswish_accessfamilywish', 'online_registration_access_family_accesswishes', 'online_registration_validation_access_family_accesswish', 'online_registration_validation_access_family_accesswishreregistrations', 'accesswish_mail', 'education_student_wish_list_accesswishreregistrations', 'education_student_wish_list_accesswish'])]
    private $accessFamilyWish;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Assert\Choice(callback: ['\AppBundle\Enum\OnlineRegistration\StatusEnum', 'toArray'], message: 'invalid-choice')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation', 'accesswish_mail_accessfamilywish'])]
    private $status;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['accesswish', 'online_registration'])]
    private $isNewMemberFamily = false;
    /**
     * @var string
     *
     * @Iri("https://schema.org/givenName")
     */
    #[ORM\Column(type: 'string', length: 50, nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Assert\Length(max: 50, maxMessage: 'invalid-max-length')]
    #[Groups(['accesswish', 'online_registration', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations', 'online_registration_validation', 'education_student_wish_list_accesswishreregistrations'])]
    private $givenName;
    /**
     * @var string
     *
     * @Iri("https://schema.org/name")
     */
    #[ORM\Column(type: 'string', length: 100, nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Assert\Length(max: 100, maxMessage: 'invalid-max-length')]
    #[Groups(['accesswish', 'online_registration', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations', 'online_registration_validation', 'education_student_wish_list_accesswishreregistrations'])]
    private $name;
    /**
     * @var File
     *
     * @Iri("https://schema.org/image")
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Core\File')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $image;
    /**
     * @var \DateTime Date of birth.
     *
     * @Iri("https://schema.org/birthDate")
     */
    #[ORM\Column(type: 'date', nullable: true)]
    #[Assert\Date(message: 'invalid-date')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations'])]
    private $birthDate;
    /**
     * @var int
     */
    #[Groups(['template', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations'])]
    protected $ageTemplate;
    /**
     * @var string Gender of the person.
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Assert\Choice(callback: ['\AppBundle\Enum\Person\GenderEnum', 'toArray'], message: 'invalid-choice')]
    #[Groups(['accesswish', 'online_registration', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations', 'online_registration_validation'])]
    private $genderEnum;
    /**
     * @var string Email address.
     *
     * @Iri("https://schema.org/email")
     */
    #[ORM\Column(type: 'string', length: 255, nullable: true)]
    #[Assert\Email(strict: true, message: 'invalid-email-format')]
    #[Assert\Email(checkMX: true, message: 'invalid-email-domain')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation', 'accesswish_mail', 'accesswish_mail_accessfamilywish', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations'])]
    private $email;
    /**
     * @var string
     *
     * @AssertPhoneNumber
     */
    #[ORM\Column(type: 'phone_number', nullable: true)]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations'])]
    private $telphone;
    /**
     * @var string
     *
     * @AssertPhoneNumber
     */
    #[ORM\Column(type: 'phone_number', nullable: true)]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations'])]
    private $mobilPhone;
    /**
     * @var Country
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Core\Country')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $addressCountry;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 100, nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Assert\Length(max: 100, maxMessage: 'invalid-max-length')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $addressCity;
    /**
     * @var string
     *
     * @OpentalentAssert\PostalCode
     */
    #[ORM\Column(type: 'string', length: 20, nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $postalCode;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $streetAddress;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $streetAddressSecond;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $streetAddressThird;
    /**
     * @var ArrayCollection<EducationStudentWish>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\AccessWish\EducationStudentWish', mappedBy: 'accessWish', cascade: ['persist'], orphanRemoval: true)]
    #[Groups(['accesswish_educationstudentwish', 'online_registration', 'online_registration_validation'])]
    private $educationStudentWishes;
    /**
     * @var ArrayCollection<EducationStudentWish>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\AccessWish\EducationStudentWish', mappedBy: 'accessWishReregistrations', cascade: ['persist'], orphanRemoval: true)]
    #[Groups(['accesswish_educationstudentwish', 'online_registration', 'online_registration_validation'])]
    private $educationStudentReregistrationsWishes;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $profession;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => true])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $imageRight = true;
    /**
     * @var string
     */
    #[ORM\Column(type: 'text', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $medicalComments;
    /**
     * @var string
     */
    #[ORM\Column(type: 'text', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $notes;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 255, nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $establishmentName;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 255, nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $cityName;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 255, nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $disponibility;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 255, nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $className;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 255, nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $teacherName;
    /**
     * @var ArrayCollection<EducationStudentWish>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\AccessWish\DocumentWish', mappedBy: 'accessWish', cascade: ['persist'])]
    #[Groups(['accesswish_documentwish', 'online_registration', 'online_registration_validation'])]
    private $documentWishes;
    /**
     * @var string
     *
     * @ExportSplitFields({"name","givenName"})
     */
    #[Groups(['accesswish'])]
    private $fullNameTemplate;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => true])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    private $synchro = false;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $approveRulesProcedureWish = false;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $receiveInformationsFromOrganizationWish = false;
    /**
     * @var ArrayCollection<Tagg>
     */
    #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Core\Tagg', cascade: ['persist'], inversedBy: 'accessWishes')]
    #[Assert\Valid]
    #[ORM\JoinTable(name: 'tag_accessWish', joinColumns: [], inverseJoinColumns: [])]
    #[ORM\JoinColumn(name: 'accessWish_id', referencedColumnName: 'id')]
    #[ORM\JoinColumn(name: 'tag_id', referencedColumnName: 'id')]
    #[Groups(['accesswish_tags', 'manage_tags'])]
    private $tags;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', options: ['default' => 'OPEN'])]
    #[Assert\Type(type: 'string')]
    #[Assert\Choice(callback: ['\AppBundle\Enum\OnlineRegistration\ValidationStateEnum', 'toArray'], message: 'invalid-choice')]
    #[Groups(['accesswish', 'online_registration_validation'])]
    private $validationState = "OPEN";
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
    private $isValidated = false;
    /**
     * @var string
     * @ExportSplitFields({"gender","name","givenName","email","telphone","mobilPhone","addressCity","postalCode","streetAddress"})
     */
    #[Groups(['education_student_wish_list_accesswishreregistrations', 'education_student_wish_list_accesswish'])]
    private $fullNameAndContactTemplate;
    public function __construct()
    {
        $this->educationStudentWishes = new ArrayCollection();
        $this->educationStudentReregistrationsWishes = new ArrayCollection();
        $this->documentWishes = new ArrayCollection();
        $this->tags = new ArrayCollection();
    }
    /**
     * 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 organization
     *
     * @param \AppBundle\Entity\Organization\Organization $organization
     *
     * @return AccessWish
     */
    public function setOrganization(\AppBundle\Entity\Organization\Organization $organization)
    {
        $this->organization = $organization;

        return $this;
    }
    /**
     * Get organization
     *
     * @return \AppBundle\Entity\Organization\Organization
     */
    public function getOrganization()
    {
        return $this->organization;
    }
    /**
     * Set givenName
     *
     * @param string $givenName
     *
     * @return AccessWish
     */
    public function setGivenName($givenName)
    {
        $this->givenName = $givenName;

        return $this;
    }
    /**
     * Get givenName
     *
     * @return string
     */
    public function getGivenName()
    {
        return $this->givenName;
    }
    /**
     * Sets name.
     *
     * @param string $name
     *
     * @return $this
     */
    public function setName($name)
    {
        $this->name = strtoupper($name);

        return $this;
    }
    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }
    /**
     * Set birthDate
     *
     * @param \DateTime $birthDate
     *
     * @return AccessWish
     */
    public function setBirthDate($birthDate)
    {
        $this->birthDate = $birthDate;

        return $this;
    }
    /**
     * Get birthDate
     *
     * @return \DateTime
     */
    public function getBirthDate()
    {
        return $this->birthDate ? $this->birthDate->format('Y-m-d') : $this->birthDate;
    }
    /**
     * Set genderEnum
     *
     * @param string $genderEnum
     *
     * @return AccessWish
     */
    public function setGenderEnum($genderEnum)
    {
        $this->genderEnum = $genderEnum;

        return $this;
    }
    /**
     * Get genderEnum
     *
     * @return string
     */
    public function getGenderEnum()
    {
        return $this->genderEnum;
    }
    /**
     * Set email
     *
     * @param string $email
     *
     * @return AccessWish
     */
    public function setEmail($email)
    {
        $this->email = $email;

        return $this;
    }
    /**
     * Get email
     *
     * @return string
     */
    public function getEmail()
    {
        return $this->email;
    }
    /**
     * Sets telphone.
     *
     * @param string $telphone
     *
     * @return $this
     */
    public function setTelphone($telphone)
    {
        if(empty($telphone))$telphone = null;

        if(is_null($telphone)) $this->telphone = $telphone;
        else{
            $phoneUtil = PhoneNumberUtil::getInstance();
            $phoneNumber = $phoneUtil->parse($telphone, PhoneNumberUtil::UNKNOWN_REGION);
            $this->telphone = $phoneNumber;
        }

        return $this;
    }
    public function setPhoneNumberTelphone($phoneNumberTelphone)
    {
        $this->telphone = $phoneNumberTelphone;
    }
    /**
     * Get telphone
     *
     * @return phone_number
     */
    public function getTelphone()
    {
        return $this->telphone;
    }
    /**
     * Sets mobilPhone.
     *
     * @param string $mobilPhone
     *
     * @return $this
     */
    public function setMobilPhone($mobilPhone)
    {
        if(empty($mobilPhone))$mobilPhone = null;

        if(is_null($mobilPhone)) $this->mobilPhone = $mobilPhone;
        else{
            $phoneUtil = PhoneNumberUtil::getInstance();
            $phoneNumber = $phoneUtil->parse($mobilPhone, PhoneNumberUtil::UNKNOWN_REGION);
            $this->mobilPhone = $phoneNumber;
        }

        return $this;
    }
    public function setPhoneNumberMobilPhone($phoneNumberMobilPhone){
        $this->mobilPhone = $phoneNumberMobilPhone;
    }
    /**
     * Get mobilPhone
     *
     * @return phone_number
     */
    public function getMobilPhone()
    {
        return $this->mobilPhone;
    }
    /**
     * Set addressCity
     *
     * @param string $addressCity
     *
     * @return AccessWish
     */
    public function setAddressCity($addressCity)
    {
        $this->addressCity = $addressCity;

        return $this;
    }
    /**
     * Get addressCity
     *
     * @return string
     */
    public function getAddressCity()
    {
        return $this->addressCity;
    }
    /**
     * Set postalCode
     *
     * @param string $postalCode
     *
     * @return AccessWish
     */
    public function setPostalCode($postalCode)
    {
        $this->postalCode = $postalCode;

        return $this;
    }
    /**
     * Get postalCode
     *
     * @return string
     */
    public function getPostalCode()
    {
        return $this->postalCode;
    }
    /**
     * Set streetAddress
     *
     * @param string $streetAddress
     *
     * @return AccessWish
     */
    public function setStreetAddress($streetAddress)
    {
        $this->streetAddress = $streetAddress;

        return $this;
    }
    /**
     * Get streetAddress
     *
     * @return string
     */
    public function getStreetAddress()
    {
        return $this->streetAddress;
    }
    /**
     * Set streetAddressSecond
     *
     * @param string $streetAddressSecond
     *
     * @return AccessWish
     */
    public function setStreetAddressSecond($streetAddressSecond)
    {
        $this->streetAddressSecond = $streetAddressSecond;

        return $this;
    }
    /**
     * Get streetAddressSecond
     *
     * @return string
     */
    public function getStreetAddressSecond()
    {
        return $this->streetAddressSecond;
    }
    /**
     * Set streetAddressThird
     *
     * @param string $streetAddressThird
     *
     * @return AccessWish
     */
    public function setStreetAddressThird($streetAddressThird)
    {
        $this->streetAddressThird = $streetAddressThird;

        return $this;
    }
    /**
     * Get streetAddressThird
     *
     * @return string
     */
    public function getStreetAddressThird()
    {
        return $this->streetAddressThird;
    }
    /**
     * Set image
     *
     * @param \AppBundle\Entity\Core\File $image
     *
     * @return AccessWish
     */
    public function setImage(\AppBundle\Entity\Core\File $image = null)
    {
        $this->image = $image;

        return $this;
    }
    /**
     * Get image
     *
     * @return \AppBundle\Entity\Core\File
     */
    public function getImage()
    {
        return $this->image;
    }
    /**
     * Set addressCountry
     *
     * @param \AppBundle\Entity\Core\Country $addressCountry
     *
     * @return AccessWish
     */
    public function setAddressCountry(\AppBundle\Entity\Core\Country $addressCountry = null)
    {
        $this->addressCountry = $addressCountry;

        return $this;
    }
    /**
     * Get addressCountry
     *
     * @return \AppBundle\Entity\AccessWish\Country
     */
    public function getAddressCountry()
    {
        return $this->addressCountry;
    }
    /**
     * Add educationStudentWish
     *
     * @param \AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentWish
     *
     * @return AccessWish
     */
    public function addEducationStudentWish(\AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentWish)
    {
        $educationStudentWish->setAccessWish($this);
        $this->educationStudentWishes[] = $educationStudentWish;

        return $this;
    }
    /**
     * Remove educationStudentWish
     *
     * @param \AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentWish
     */
    public function removeEducationStudentWish(\AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentWish)
    {
        $this->educationStudentWishes->removeElement($educationStudentWish);
    }
    /**
     * Get educationStudentWishes
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEducationStudentWishes()
    {
        return $this->educationStudentWishes;
    }
    /**
     * Set imageRight
     *
     * @param boolean $imageRight
     *
     * @return AccessWish
     */
    public function setImageRight($imageRight)
    {
        $this->imageRight = $imageRight;

        return $this;
    }
    /**
     * Get imageRight
     *
     * @return boolean
     */
    public function getImageRight()
    {
        return $this->imageRight;
    }
    /**
     * Set medicalComments
     *
     * @param string $medicalComments
     *
     * @return AccessWish
     */
    public function setMedicalComments($medicalComments)
    {
        $this->medicalComments = $medicalComments;

        return $this;
    }
    /**
     * Get medicalComments
     *
     * @return string
     */
    public function getMedicalComments()
    {
        return $this->medicalComments;
    }
    /**
     * Set notes
     *
     * @param string $notes
     *
     * @return AccessWish
     */
    public function setNotes($notes)
    {
        $this->notes = $notes;

        return $this;
    }
    /**
     * Get notes
     *
     * @return string
     */
    public function getNotes()
    {
        return $this->notes;
    }
    /**
     * Set profession
     *
     * @param string $profession
     *
     * @return AccessWish
     */
    public function setProfession($profession)
    {
        $this->profession = $profession;

        return $this;
    }
    /**
     * Get profession
     *
     * @return string
     */
    public function getProfession()
    {
        return $this->profession;
    }
    /**
     * Set establishmentName
     *
     * @param string $establishmentName
     *
     * @return AccessWish
     */
    public function setEstablishmentName($establishmentName)
    {
        $this->establishmentName = $establishmentName;

        return $this;
    }
    /**
     * Get establishmentName
     *
     * @return string
     */
    public function getEstablishmentName()
    {
        return $this->establishmentName;
    }
    /**
     * Set cityName
     *
     * @param string $cityName
     *
     * @return AccessWish
     */
    public function setCityName($cityName)
    {
        $this->cityName = $cityName;

        return $this;
    }
    /**
     * Get cityName
     *
     * @return string
     */
    public function getCityName()
    {
        return $this->cityName;
    }
    /**
     * Set disponibility
     *
     * @param string $disponibility
     *
     * @return AccessWish
     */
    public function setDisponibility($disponibility)
    {
        $this->disponibility = $disponibility;

        return $this;
    }
    /**
     * Get disponibility
     *
     * @return string
     */
    public function getDisponibility()
    {
        return $this->disponibility;
    }
    /**
     * Set className
     *
     * @param string $className
     *
     * @return AccessWish
     */
    public function setClassName($className)
    {
        $this->className = $className;

        return $this;
    }
    /**
     * Get className
     *
     * @return string
     */
    public function getClassName()
    {
        return $this->className;
    }
    /**
     * Set teacherName
     *
     * @param string $teacherName
     *
     * @return AccessWish
     */
    public function setTeacherName($teacherName)
    {
        $this->teacherName = $teacherName;

        return $this;
    }
    /**
     * Get teacher
     *
     * @return string
     */
    public function getTeacherName()
    {
        return $this->teacherName;
    }
    /**
     * Add documentWish
     *
     * @param \AppBundle\Entity\AccessWish\DocumentWish $documentWish
     *
     * @return AccessWish
     */
    public function addDocumentWish(\AppBundle\Entity\AccessWish\DocumentWish $documentWish)
    {
        $documentWish->setAccessWish($this);
        $this->documentWishes[] = $documentWish;

        return $this;
    }
    /**
     * Remove documentWish
     *
     * @param \AppBundle\Entity\AccessWish\DocumentWish $documentWish
     */
    public function removeDocumentWish(\AppBundle\Entity\AccessWish\DocumentWish $documentWish)
    {
        $this->documentWishes->removeElement($documentWish);
    }
    /**
     * Get documentWishes
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getDocumentWishes()
    {
        return $this->documentWishes;
    }
    /**
     * Gets full name.
     *
     * @return string
     */
    public function getFullNameTemplate()
    {
        return $this->getName() . ' ' . $this->getGivenName();
    }
    /**
     * Set accessOriginal
     *
     * @param \AppBundle\Entity\AccessAndFunction\Access $accessOriginal
     *
     * @return AccessWish
     */
    public function setAccessOriginal(\AppBundle\Entity\AccessAndFunction\Access $accessOriginal = null)
    {
        $this->accessOriginal = $accessOriginal;

        return $this;
    }
    /**
     * Get accessOriginal
     *
     * @return \AppBundle\Entity\AccessAndFunction\Access
     */
    public function getAccessOriginal()
    {
        return $this->accessOriginal;
    }
    /**
     * Set accessFamilyWish
     *
     * @param \AppBundle\Entity\AccessWish\AccessFamilyWish $accessFamilyWish
     *
     * @return AccessWish
     */
    public function setAccessFamilyWish(\AppBundle\Entity\AccessWish\AccessFamilyWish $accessFamilyWish = null)
    {
        $this->accessFamilyWish = $accessFamilyWish;

        return $this;
    }
    /**
     * Get accessFamilyWish
     *
     * @return \AppBundle\Entity\AccessWish\AccessFamilyWish
     */
    public function getAccessFamilyWish()
    {
        return $this->accessFamilyWish;
    }
    /**
     * Set status
     *
     * @param string $status
     *
     * @return AccessWish
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }
    /**
     * Get status
     *
     * @return string
     */
    public function getStatus()
    {
        return $this->status;
    }
    /**
     * Add educationStudentReregistrationsWish
     *
     * @param \AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentReregistrationsWish
     *
     * @return AccessWish
     */
    public function addEducationStudentReregistrationsWish(\AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentReregistrationsWish)
    {
        $educationStudentReregistrationsWish->setAccessWishReregistrations($this);
        $this->educationStudentReregistrationsWishes[] = $educationStudentReregistrationsWish;

        return $this;
    }
    /**
     * Remove educationStudentReregistrationsWish
     *
     * @param \AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentReregistrationsWish
     */
    public function removeEducationStudentReregistrationsWish(\AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentReregistrationsWish)
    {
        $this->educationStudentReregistrationsWishes->removeElement($educationStudentReregistrationsWish);
    }
    /**
     * Get educationStudentReregistrationsWishes
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEducationStudentReregistrationsWishes()
    {
        return $this->educationStudentReregistrationsWishes;
    }
    /**
     * Set synchro
     *
     * @param boolean $synchro
     *
     * @return AccessWish
     */
    public function setSynchro($synchro)
    {
        $this->synchro = $synchro;

        return $this;
    }
    /**
     * Get synchro
     *
     * @return boolean
     */
    public function getSynchro()
    {
        return $this->synchro;
    }
    /**
     * Set approveRulesProcedureWish
     *
     * @param boolean $approveRulesProcedureWish
     *
     * @return AccessWish
     */
    public function setApproveRulesProcedureWish($approveRulesProcedureWish)
    {
        $this->approveRulesProcedureWish = $approveRulesProcedureWish;

        return $this;
    }
    /**
     * Get approveRulesProcedureWish
     *
     * @return boolean
     */
    public function getApproveRulesProcedureWish()
    {
        return $this->approveRulesProcedureWish;
    }
    /**
     * Set receiveInformationsFromOrganizationWish
     *
     * @param boolean $receiveInformationsFromOrganizationWish
     *
     * @return AccessWish
     */
    public function setReceiveInformationsFromOrganizationWish($receiveInformationsFromOrganizationWish)
    {
        $this->receiveInformationsFromOrganizationWish = $receiveInformationsFromOrganizationWish;

        return $this;
    }
    /**
     * Get receiveInformationsFromOrganizationWish
     *
     * @return boolean
     */
    public function getReceiveInformationsFromOrganizationWish()
    {
        return $this->receiveInformationsFromOrganizationWish;
    }
    /**
     * Set isNewMemberFamily
     *
     * @param boolean $isNewMemberFamily
     *
     * @return AccessWish
     */
    public function setIsNewMemberFamily($isNewMemberFamily)
    {
        $this->isNewMemberFamily = $isNewMemberFamily;

        return $this;
    }
    /**
     * Get isNewMemberFamily
     *
     * @return boolean
     */
    public function getIsNewMemberFamily()
    {
        return $this->isNewMemberFamily;
    }
    /**
     * Add tag
     *
     * @param \AppBundle\Entity\Core\Tagg $tag
     *
     * @return AccessWish
     */
    public function addTag(\AppBundle\Entity\Core\Tagg $tag)
    {
        $this->tags[] = $tag;

        return $this;
    }
    /**
     * Remove tag
     *
     * @param \AppBundle\Entity\Core\Tagg $tag
     */
    public function removeTag(\AppBundle\Entity\Core\Tagg $tag)
    {
        $this->tags->removeElement($tag);
    }
    /**
     * Get tags
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getTags()
    {
        return $this->tags;
    }
    public function getAgeTemplate()
    {
        $from = new \DateTime($this->getBirthDate());
        $to = new \DateTime('today');
        $age = $from->diff($to)->y;
        return $age > 0 ? $age : null;
    }
    /**
     * Gets full name.
     *
     * @return array
     */
    public function getFullNameAndContactTemplate()
    {
        if(!empty($this->getGenderEnum())){
            $fullNameAndContactTemplate[] = [ 'value' => $this->getGenderEnum(), 'translate' => true ];
            $fullNameAndContactTemplate[] = ' - ';
        }

        $fullNameAndContactTemplate[] = $this->getFullNameTemplate();

        if(!empty($this->getEmail()) || !empty($this->getTelphone()) || !empty($this->getMobilPhone())){
            $fullNameAndContactTemplate[] = ' - ';
            if(!empty($this->getEmail()))
                $fullNameAndContactTemplate[] = $this->getEmail();
            if(!empty($this->getTelphone()))
                $fullNameAndContactTemplate[] =  ['type' => 'phone_number', 'value' => $this->getTelphone(), 'separator' => ' / '];
            if(!empty($this->getMobilPhone()))
                $fullNameAndContactTemplate[] = ['type' => 'phone_number', 'value' => $this->getMobilPhone(), 'separator' => ' / '];
        }

        if(!empty($this->getStreetAddress()) || !empty($this->getCityName())){
            $fullNameAndContactTemplate[] = ' - ';
            if(!empty($this->getStreetAddress()))
                $fullNameAndContactTemplate[] = $this->getStreetAddress();
            if(!empty($this->getPostalCode()))
                $fullNameAndContactTemplate[] = $this->getPostalCode();
            if(!empty($this->getCityName()))
                $fullNameAndContactTemplate[] = $this->getCityName();
        }

        return $fullNameAndContactTemplate;
    }
    /**
     * Set validationState
     *
     * @param string $validationState
     *
     * @return AccessWish
     */
    public function setValidationState($validationState)
    {
        $this->validationState = $validationState;

        return $this;
    }
    /**
     * Get validationState
     *
     * @return string
     */
    public function getValidationState()
    {
        return $this->validationState;
    }
    /**
     * Set isValidated
     *
     * @param boolean $isValidated
     *
     * @return AccessWish
     */
    public function setIsValidated($isValidated)
    {
        $this->isValidated = $isValidated;

        return $this;
    }
    /**
     * Get isValidated
     *
     * @return boolean
     */
    public function getIsValidated()
    {
        return $this->isValidated;
    }
}
