<?php

namespace AppBundle\Entity\AccessAndFunction;

use AppBundle\Annotation\DefaultField;
use AppBundle\Entity\AccessWish\AccessWish;
use AppBundle\Entity\Billing\AccessBilling;
use AppBundle\Entity\Billing\AccessIntangible;
use AppBundle\Entity\Billing\AccessPayer;
use AppBundle\Entity\Billing\BillCredit;
use AppBundle\Entity\Booking\AbstractBooking;
use AppBundle\Entity\Booking\CalendarSynchro;
use AppBundle\Entity\Booking\Course;
use AppBundle\Entity\Booking\WorkByUser;
use AppBundle\Entity\Education\EducationNotationConfig;
use AppBundle\Entity\Education\EducationStudent;
use AppBundle\Entity\Organization\Parameters;
use AppBundle\Entity\Person\CompanyPerson;
use AppBundle\Entity\Person\Medal;
use AppBundle\Entity\Person\PersonActivity;
use AppBundle\Entity\Person\PersonBilling;
use AppBundle\Entity\Person\ProfessionalInformation;
use AppBundle\Entity\Product\EquipmentLoan;
use AppBundle\Entity\Product\Loan;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use DoctrineExtensions\Query\Mysql\Date;
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;
use AppBundle\Entity\Organization\Organization;
use AppBundle\Entity\Person\Person;
use AppBundle\Validator\Constraints\Delete as OpentalentDelete;
use AppBundle\Entity\Booking\PersonHoliday;
use AppBundle\Entity\Core\ContactInterface;
use AppBundle\Validator\Constraints\Education as OpentalentEducationAssert;

/**
 * Fais le lien entre une Person et une Organization
 *
 *
 * @Iri("http://schema.org/Access")
 * @OpentalentDelete\EntityDelete()
 */
#[ORM\Entity(repositoryClass: 'AppBundle\Entity\AccessAndFunction\Repository\AccessRepository')]
#[ORM\Table(name: 'Access')]
#[ORM\UniqueConstraint(name: 'person_organization_idx', columns: ['person_id', 'organization_id'])]
class Access implements ContactInterface
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['access', 'email_detail', 'access_details', 'access_mass', 'student_list', 'billaccounting_list', 'bill_list', 'billaccounting_list_billlines', 'equipment_list', 'equipmentrent_list', 'equipmentloan_list', 'equipmentcontrol_list', 'equipmentrepair_list', 'equipmentaccounting_list', 'equipmentmediatheque_list', 'equipmentcostume_list', 'message_list', 'messagesend_list', 'educationstudent_notation', 'template_list', 'othercontact_list', 'placerepair_list', 'commission_list_commissionmembers', 'attendancebooking_list', 'donor_list', 'examenconvocation_list', 'medal_list', 'viewaudit_list', 'my_student_list', 'planning_list', 'report_card_guardians', 'report_card_educationstudent', 'access_details_companypersoncompany', 'student_registration', 'student_registration_accessfamily', 'access_details_organization', 'presence_attendance', 'presence_attendance_jury', 'access_informations_edit', 'access_informations_edit_accessfamily', 'equipment_details', 'accesses_list', 'student_list_courses', 'adherent_list_guardians', 'own_access', 'own_student_access', 'event_details', 'board_list', 'attendance_list', 'course_details', 'educationalproject_details', 'networkmanagers_list', 'educationstudent_reference', 'educationteacher_reference', 'network_list', 'adherent_contact', 'equipmentmediatheque_list', 'organization_create', 'planning_detail', 'payer_list', 'billcredit_list', 'booking_event', 'invitations_list', 'accessbilling_edit', 'equipment_list_equipmentloan', 'equipmentmediatheque_list_equipmentloan', 'equipmentmediatheque_list', 'equipmentcostume_list_equipmentloan', 'sepa_debit_mandate', 'cotisation_responsibles_accesses', 'fusion_accesses', 'bill_list_billlines', 'equipment_availability_form', 'education_input_list', 'my_bills_show', 'online_registration_access_details', 'online_registration_access_family', 'education_student_next_year', 'access_files', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations', 'billpayment_list_bill', 'accesses_no_reregistred_list', 'accessholidays_list', 'education_student_next_year', 'equipmentloan_list', 'equipmentrent_list', 'examenconvocation_list', 'access_intangible_list', 'advancepayment_list', 'education_student_next_year_edit', 'build_bills', 'access_intangible_list', 'advancepayment_list', 'online_registration_validation'])]
    private $id;
    /**
     * @var Person
     *
     *
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Person\Person', inversedBy: 'access', cascade: ['persist'])]
    #[Assert\NotNull]
    #[Groups(['access', 'worksbyusers_db_work', 'access_details', 'access_mass', 'access_reference', 'access_details_person', 'student_list_guardians', 'access_details_accessfamily', 'access_details_guardians', 'access_details_children', 'access_details_companyperson', 'access_details_accessfamily', 'student_list', 'guardians_list', 'all_accesses_list', 'guardians_list_children', 'teachers_list', 'adherent_list', 'personnels_list', 'morals_list', 'morals_list_companypersonaccesses', 'ca_list', 'accesses_list', 'rule', 'billaccounting_list_access', 'bill_list_access', 'access_details_billingpayers', 'billaccounting_list_billlines', 'equipment_list_supplier', 'equipment_list_access', 'equipmentrent_list_borrower', 'equipmentloan_list_borrower', 'equipmentcontrol_list_accompanist', 'equipmentcontrol_list_equipment', 'equipmentrepair_list_provider', 'equipmentaccounting_list_supplier', 'equipmentmediatheque_list_supplier', 'equipmentcostume_list_access', 'message_list_author', 'messagesend_list_author', 'template_list_author', 'othercontact_list', 'placerepair_list_provider', 'commission_list_commissionmembers', 'attendancebooking_list_access', 'donor_list_access', 'examenconvocation_list_student', 'medal_list_access', 'viewaudit_list_createdby', 'viewaudit_list_updatedby', 'my_student_list_access', 'report_card', 'report_card_guardians', 'report_card_educationstudent', 'access_details_educationstudent', 'access_details_companypersonaccesses', 'access_details_companypersoncompany', 'student_registration', 'student_registration_guardians', 'student_registration_accessfamily', 'presence_attendance_convocation', 'presence_attendance_students', 'presence_attendance_eventuser', 'access_details_organization', 'access_informations_edit', 'equipment_details_editor', 'equipmentmediatheque_list_editor', 'equipment_details_supplier', 'equipment_details_managercontrol', 'equipment_details_equipmentrepair', 'equipment_details_equipmentloanfiltered', 'accesses_list_guardians', 'student_list_courses', 'adherent_list_guardians', 'access_duplicate_control_list', 'own_access', 'own_student_access', 'event_details_organizer', 'accesscmfnetwork', 'board_list', 'attendance_list_access', 'attendance_list_replacement', 'event_details_eventuserfiltered', 'event_details_eventuser', 'examen_details_convocation', 'examen_details_jury', 'course_details_organizer', 'course_details_students', 'educationalproject_details_silentpartner', 'educationalproject_details_operationalpartner', 'educationalproject_details_financiers', 'educationalproject_details_billingreceivers', 'educationalproject_details_organizer', 'licence_cmf', 'networkmanagers_list', 'my_access_put', 'educationstudent_reference_access', 'educationstudent_reference_teachers', 'educationteacher_reference_teacher', 'network_list_adminaccess', 'adherent_contact', 'adherent_contact_guardians', 'access_mail', 'access_details_accessfamily', 'student_list_educationstudent', 'access_mail_guardians', 'othercontact_list_companypersoncompany', 'accesses_rules', 'billpayment_list_bill', 'educationnotation_list_educationstudent', 'organization_create_access', 'planning_detail_organizer', 'planning_detail_students', 'planning_detail_attendancebooking', 'planning_detail_convocation', 'planning_detail_jury', 'organization_details_organizationlicences', 'payer_list', 'payer_list_billingpayers', 'billcredit_list_access', 'invitations_list_guest', 'equipment_list_equipmentloan', 'equipmentmediatheque_list_equipmentloan', 'equipmentmediatheque_list_access', 'equipmentcostume_list_equipmentloan', 'sepa_debit_mandate', 'cotisation_responsibles_accesses', 'fusion_accesses', 'equipment_availability_form_borrower', 'course_details_attendancebooking', 'examen_details_attendancebooking', 'educationalproject_details_attendancebooking', 'event_details_attendancebooking', 'accessbilling_edit', 'equipment_availability_form_borrower', 'education_input_list_access', 'education_input_list_teachers', 'view_from_manager_create', 'accessbilling_edit', 'examen_details_attendancebooking', 'view_from_manager_create', 'bill_list_billlines', 'attendancebooking_list_course', 'education_student_next_year_access', 'education_student_next_year_teachers', 'education_student_next_year_educationstudentlastyear', 'online_registration_access_details', 'access_files', 'access_intangible_list_access', 'accesses_no_reregistred_list', 'billpayment_list_bill', 'educationstudent_notation_access', 'accesses_no_reregistred_list_educationstudent', 'accesses_no_reregistred_list_guardians', 'accessholidays_list_access', 'email_detail_author', 'cmf_network_persons', 'advancepayment_list_access', 'build_bills_access', 'build_bills_billlines', 'cmf_network_persons', 'advancepayment_list_access', 'billpayment_list_accessbillingaccountbalancereimbursement'])]
    #[Assert\Valid]
    private $person;
    /**
     * @var Organization
     *
     * @DefaultField
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Organization\Organization', inversedBy: 'access')]
    #[ORM\JoinColumn(nullable: false)]
    #[Assert\NotNull]
    #[Groups(['access', 'access_details', 'adherent_list', 'all_accesses_list', 'networkmanagers_list', 'accesses_rules', 'cotisation_responsibles_accesses'])]
    private $organization;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['organization_create_access'])]
    private $adminAccess = false;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    private $superAdminAccess = false;
    /**
     * @var array
     */
    #[ORM\Column(type: 'json_array', length: 4294967295, nullable: true)]
    #[Groups(['access'])]
    private $roles;
    /**
     * @var array
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Groups(['access'])]
    private $personalizedRoles = false;
    #[Assert\Valid]
    #[ORM\ManyToMany(targetEntity: 'Access', mappedBy: 'children', cascade: ['persist'])]
    #[Groups(['access', 'guardian', 'access_details', 'student_list', 'report_card', 'student_registration', 'access_informations_edit', 'accesses_list', 'adherent_list', 'adherent_contact', 'access_mail', 'online_registration_access_details', 'accesses_no_reregistred_list'])]
    private $guardians;
    #[ORM\ManyToMany(targetEntity: 'Access', inversedBy: 'guardians', cascade: ['persist'])]
    #[ORM\JoinTable(name: 'children_guardians', joinColumns: [], inverseJoinColumns: [])]
    #[ORM\JoinColumn(name: 'guardians_id', referencedColumnName: 'id')]
    #[ORM\JoinColumn(name: 'children_id', referencedColumnName: 'id')]
    #[Groups(['access', 'access_details', 'guardians_list', 'access_informations_edit'])]
    private $children;
    /**
     * @var ArrayCollection<CompanyPerson>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Person\CompanyPerson', cascade: ['persist'], mappedBy: 'company', orphanRemoval: true)]
    #[Groups(['access_companypersonaccess', 'access_details', 'morals_list'])]
    private $companyPersonAccesses;
    /**
     * @var ArrayCollection<CompanyPerson>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Person\CompanyPerson', cascade: ['persist'], mappedBy: 'access', orphanRemoval: true)]
    #[Groups(['access_personcompany', 'othercontact_list', 'othercontact_list_companypersoncompany', 'access_details'])]
    private $companyPersonCompany;
    /**
     * @var ArrayCollection<EducationStudent>
     *
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Education\EducationStudent', mappedBy: 'access', orphanRemoval: true, cascade: ['persist'])]
    #[Groups(['access_educationstudent', 'access_details', 'student_list', 'report_card', 'student_registration', 'examenconvocation_list_student', 'online_registration_access_details', 'accesses_no_reregistred_list'])]
    private $educationStudent;
    /**
     * @var ArrayCollection<EducationStudent>
     */
    #[Assert\Valid]
    #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Education\EducationStudent', mappedBy: 'teachers', orphanRemoval: true, cascade: ['persist'])]
    private $educationStudentByTeacher;
    /**
     * @var ArrayCollection<EducationTeacher>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Education\EducationTeacher', mappedBy: 'teacher', orphanRemoval: true)]
    #[Groups(['access_educationteacher'])]
    private $educationTeachers;
    /**
     * @var ArrayCollection<OrganizationFunction>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\AccessAndFunction\OrganizationFunction', mappedBy: 'access', orphanRemoval: true, cascade: ['persist'])]
    #[Groups(['access_organizationfunction', 'access_details', 'adherent_list', 'personnels_list', 'ca_list', 'accesses_list', 'othercontact_list', 'student_registration', 'student_registration_guardians', 'student_registration_accessfamily', 'board_list', 'licence_cmf', 'access_informations_edit', 'adherent_contact', 'cotisation_responsibles_accesses', 'view_from_manager_create', 'networkmanagers_list', 'online_registration_access_details', 'accesscmfnetwork'])]
    private $organizationFunction;
    /**
     * @var ArrayCollection<PersonActivity>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Person\PersonActivity', mappedBy: 'access', orphanRemoval: true, cascade: ['persist'])]
    #[Groups(['access_personactivity', 'access_details', 'student_list', 'adherent_list', 'accesses_list', 'othercontact_list', 'ca_list', 'board_list', 'licence_cmf', 'adherent_contact', 'invitations_list_guest'])]
    private $personActivity;
    /**
     * @var ArrayCollection<PersonActivity>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Person\PersonActivity', mappedBy: 'access', orphanRemoval: true, cascade: ['persist'], fetch: 'EXTRA_LAZY')]
    #[Groups(['rule', 'presence_attendance_eventuser', 'accesses_rules'])]
    private $personActivityActive;
    /**
     * @var ArrayCollection<PersonHoliday>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\PersonHoliday', mappedBy: 'access', cascade: ['persist'], orphanRemoval: true)]
    #[Groups(['access_personholiday'])]
    private $holidays;
    /**
     * @var Course
     */
    #[Assert\Valid]
    #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Booking\Course', mappedBy: 'students', cascade: ['persist'])]
    #[Groups(['access_course', 'access_details', 'student_list', 'edu_stu_courses', 'student_registration', 'education_input_list_access'])]
    private $courses;
    #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Booking\Course', mappedBy: 'students', fetch: 'EXTRA_LAZY')]
    #[Groups(['student_list'])]
    private $coursesFiltered;
    #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Booking\Course', mappedBy: 'students', fetch: 'EXTRA_LAZY')]
    #[Groups(['education_student_next_year_access'])]
    private $coursesNextYear;
    /**
     * @var Course
     */
    #[Assert\Valid]
    #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Booking\Course', mappedBy: 'organizer', cascade: ['persist'])]
    #[Groups(['access_practicalcourses', 'access_details', 'accesses_courseteacher_show'])]
    private $practicalCourses;
    /**
     * @var AbstractBooking
     */
    #[Assert\Valid]
    #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Booking\AbstractBooking', mappedBy: 'organizer', cascade: ['persist'])]
    private $bookingOrganizers;
    /**
     * @var AccessBilling
     */
    #[Assert\Valid]
    #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\Billing\AccessBilling', mappedBy: 'access', cascade: ['persist'], orphanRemoval: true, fetch: 'EAGER')]
    #[Groups(['access', 'access_mass', 'access_details', 'student_registration', 'student_registration_guardians', 'accesses_list', 'student_list', 'guardians_list', 'adherent_list', 'bill_list_access', 'payer_list', 'accessbilling_edit', 'sepa_debit_mandate', 'fusion_accesses', 'online_registration_access_details', 'build_bills_billlines', 'build_bills_access', 'online_registration_access_details', 'account_balance_reimbursements'])]
    private $accessBilling;
    /**
     * @var ArrayCollection<AccessIntangible>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\AccessIntangible', mappedBy: 'access', cascade: ['persist'], orphanRemoval: true)]
    #[Groups(['access_accessintangible', 'access_details', 'student_registration', 'accessbilling_edit'])]
    private $accessIntangibles;
    /**
     * @var AccessFamily
     */
    #[Assert\Valid]
    #[ORM\ManyToOne(targetEntity: 'AccessFamily', inversedBy: 'accesses', cascade: ['persist'])]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    #[Groups(['access', 'access_details', 'student_registration', 'access_informations_edit', 'online_registration_access_family'])]
    private $accessFamily;
    #[Groups(['access_familymembers', 'access_informations_edit'])]
    private $familyMembers;
    /**
     * @var ArrayCollection<AccessPayer>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\AccessPayer', mappedBy: 'accessPayer', cascade: ['persist'], orphanRemoval: true)]
    #[Groups(['access_accesspayer', 'access_details', 'payer_list', 'accessbilling_edit'])]
    private $billingPayers;
    /**
     * @var ArrayCollection<AccessPayer>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\AccessPayer', mappedBy: 'accessReceiver', cascade: ['persist'], orphanRemoval: true)]
    #[Groups(['access_accessreceiver', 'access_details', 'student_registration', 'payer_list', 'accessbilling_edit', 'access_intangible_list_access'])]
    private $billingReceivers;
    /**
     * @var ArrayCollection<EducationalProject>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\EducationalProjectPayer', mappedBy: 'educationalProjectPayer', cascade: ['persist'], orphanRemoval: true)]
    #[Groups(['access_educationalprojectpayer', 'accessbilling_edit'])]
    private $billingEducationalProjectPayers;
    /**
     * @var ArrayCollection<Bill>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\Bill', mappedBy: 'access', orphanRemoval: true)]
    #[Groups(['access_bill', 'my_bills_show'])]
    private $bills;
    /**
     * @var ArrayCollection<BillLine>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\BillLine', mappedBy: 'access', orphanRemoval: true)]
    #[Groups(['access_billline'])]
    private $billLines;
    /**
     * @var ArrayCollection<BillCredit>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\BillCredit', mappedBy: 'access', orphanRemoval: true)]
    #[Groups(['access_billcredit'])]
    private $billCredits;
    /**
     * @var ArrayCollection<EducationalProject>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\EducationalProject', mappedBy: 'silentPartner')]
    #[Groups(['access_educationalproject'])]
    private $silentPartners;
    /**
     * @var ArrayCollection<EducationalProject>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\EducationalProject', mappedBy: 'operationalPartner')]
    #[Groups(['access_educationalproject'])]
    private $operationalPartners;
    /**
     * @var ArrayCollection<EventUser>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\EventUser', mappedBy: 'guest', orphanRemoval: true)]
    #[Groups(['access_eventuser'])]
    private $eventUsers;
    /**
     * @var ArrayCollection<ExamenConvocation>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\ExamenConvocation', mappedBy: 'student', orphanRemoval: true)]
    #[Groups(['access_eventuser', 'report_card'])]
    private $examenConvocations;
    /**
     * @var ArrayCollection<EquipmentRepair>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Product\EquipmentRepair', mappedBy: 'provider')]
    #[Groups(['access_repair'])]
    private $equipmentRepairProviders;
    /**
     * @var ArrayCollection<Attendance>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\Attendance', mappedBy: 'access', orphanRemoval: true)]
    #[Groups(['access_attendance'])]
    private $attendances;
    /**
     * @var ArrayCollection<AttendanceBooking>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\AttendanceBooking', mappedBy: 'access', orphanRemoval: true)]
    #[Groups(['access_attendancebooking', 'report_card', 'access_attendance_detail'])]
    private $attendanceBookings;
    /**
     * @var ArrayCollection<AttendanceBooking>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\AttendanceBooking', mappedBy: 'access', orphanRemoval: true, fetch: 'EXTRA_LAZY')]
    #[ORM\OrderBy(['id' => 'DESC'])]
    #[Groups(['access_attendancebooking', 'access_details'])]
    private $attendanceBookingsFiltered;
    /**
     * @var ArrayCollection<Attendance>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\Attendance', mappedBy: 'replacement', orphanRemoval: true)]
    #[Groups(['access_attendance'])]
    private $attendanceReplacements;
    /**
     * @var ArrayCollection<EquipmentRepair>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Place\RoomRepair', mappedBy: 'provider')]
    #[Groups(['access_repair'])]
    private $roomRepairProviders;
    /**
     * @var ArrayCollection<EquipmentRepair>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Place\PlaceRepair', mappedBy: 'provider')]
    #[Groups(['access_repair'])]
    private $placeRepairProviders;
    /**
     * @var ArrayCollection<Document>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Core\Document', mappedBy: 'author')]
    #[Groups(['access_document'])]
    private $documentAuthors;
    /**
     * @var ArrayCollection<Notification>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Core\Notification', mappedBy: 'recipientAccess', orphanRemoval: true)]
    #[Groups(['access_notification'])]
    private $notifications;
    /**
     * @var ArrayCollection<NotificationUser>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Core\NotificationUser', mappedBy: 'access', orphanRemoval: true)]
    #[Groups(['access_notificationuser'])]
    private $notificationUsers;
    /**
     * @var ArrayCollection<Message>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Message\Message', mappedBy: 'author', orphanRemoval: true)]
    #[Groups(['access_message'])]
    private $messages;
    /**
     * @var ArrayCollection<JuryMember>
     */
    #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Organization\Jury', mappedBy: 'members', orphanRemoval: true)]
    #[ORM\JoinTable(name: 'juries_members')]
    #[Groups(['access_jury'])]
    private $juryMembers;
    /**
     * @var ArrayCollection<Organization>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Organization\Organization', mappedBy: 'contactPerson')]
    #[Groups(['access_organization'])]
    private $organizationContacts;
    /**
     * @var ArrayCollection<OrganizationLicence>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Organization\OrganizationLicence', mappedBy: 'licensee', orphanRemoval: true)]
    #[Groups(['access_organizationlicence'])]
    private $organizationLicences;
    /**
     * @var ArrayCollection<CommissionMember>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Person\CommissionMember', mappedBy: 'member', orphanRemoval: true)]
    #[Groups(['access_commissionmember'])]
    private $commissionMembers;
    /**
     * @var ArrayCollection<Equipment>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Product\Equipment', mappedBy: 'supplier')]
    #[Groups(['access_equipment'])]
    private $equipmentSuppliers;
    /**
     * @var ArrayCollection<Equipment>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Product\Equipment', mappedBy: 'controlManager')]
    #[Groups(['access_equipment'])]
    private $equipmentControlManagers;
    /**
     * @var ArrayCollection<Equipment>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Product\Equipment', mappedBy: 'editor')]
    #[Groups(['access_equipment'])]
    private $equipmentEditors;
    /**
     * @var ArrayCollection<EquipmentLoan>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Product\EquipmentLoan', mappedBy: 'borrower', orphanRemoval: true, cascade: ['persist'])]
    #[Groups(['access_equipmentloan', 'accessequipment_grid', 'own_access', 'own_student_access', 'access_details'])]
    private $equipmentLoans;
    /**
     * @var ArrayCollection<Control>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Core\AbstractControl', mappedBy: 'accompanist', orphanRemoval: true)]
    #[Groups(['access_equipmentloan'])]
    private $accompanistControl;
    /**
     * @var ArrayCollection<Equipment>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Product\Equipment', mappedBy: 'access', orphanRemoval: true, cascade: ['persist'])]
    #[Groups(['person_equipment', 'access_details', 'accessequipment_grid', 'own_access', 'own_student_access'])]
    private $equipments;
    /**
     * @var string
     */
    #[ORM\Column(type: 'text', nullable: true)]
    #[Assert\Type(type: 'string')]
    #[Groups(['access', 'access_details', 'access_mass', 'student_registration', 'access_informations_edit', 'accesses_list', 'student_list', 'guardians_list', 'teachers_list', 'adherent_list', 'personnels_list', 'morals_list', 'ca_list', 'othercontact_list', 'board_list', 'fusion_accesses'])]
    private $note;
    /**
     * @var ArrayCollection<AccessFictionalIntangible>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\AccessFictionalIntangible', mappedBy: 'access', cascade: ['persist'], orphanRemoval: true)]
    #[Groups(['access_accessfictionalintangible', 'access_details'])]
    private $accessFictionalIntangibles;
    /**attendance_list
     * @Assert\Valid
     * @var ArrayCollection<PersonalizedList>
     * @ORM\OneToMany(targetEntity="AppBundle\Entity\AccessAndFunction\PersonalizedList", mappedBy="access", cascade={"persist"}, orphanRemoval=true)
     * @Groups({"access_personalizedlist"})
     */
    private $personalizedLists;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Groups(['access', 'student_list', 'all_accesses_list', 'guardians_list', 'personnels_list', 'othercontact_list', 'ca_list', 'adherent_list', 'accesses_list', 'teachers_list', 'morals_list', 'board_list', 'payer_list'])]
    #[Assert\NotNull]
    private $loginEnabled = false;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Groups(['access', 'access_details', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations'])]
    #[Assert\NotNull]
    private $newAccess = false;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    private $ielEnabled = false;
    /**
     * @var \DateTime
     */
    #[ORM\Column(type: 'datetime', nullable: true)]
    #[Assert\Date]
    private $ielValidationDatetime;
    /**
     * @var \DateTime
     */
    #[ORM\Column(type: 'datetime', nullable: true)]
    #[Assert\Date]
    private $informationRetainedAndUsedDate;
    /**
     * @var \DateTime
     */
    #[ORM\Column(type: 'datetime', nullable: true)]
    #[Assert\Date]
    private $cguReadAndAcceptedDate;
    /**
     * @var array
     */
    #[ORM\Column(type: 'json_array', nullable: true)]
    #[Groups(['access', 'access_details', 'my_access_put', 'own_access'])]
    private $setting;
    /**
     * @var ArrayCollection<Donor>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Donor\Donor', cascade: ['persist'], mappedBy: 'access', orphanRemoval: true)]
    #[Groups(['access'])]
    private $donors;
    /**
     * @var ArrayCollection<Donor>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Donor\Donor', cascade: ['persist'], mappedBy: 'access', orphanRemoval: true, fetch: 'EXTRA_LAZY')]
    #[Groups(['access_details'])]
    #[ORM\OrderBy(['id' => 'DESC'])]
    private $donorsFiltered;
    /**
     * @var ArrayCollection<Medal>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Person\Medal', cascade: ['persist'], mappedBy: 'access', orphanRemoval: true)]
    #[Groups(['access', 'accesses_list', 'student_list', 'guardians_list', 'teachers_list', 'adherent_list', 'personnels_list', 'ca_list', 'othercontact_list', 'board_list'])]
    private $medals;
    /**
     * @var ArrayCollection<Medal>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Person\Medal', cascade: ['persist'], mappedBy: 'access', orphanRemoval: true, fetch: 'EXTRA_LAZY')]
    #[Groups(['access_details'])]
    #[ORM\OrderBy(['id' => 'DESC'])]
    private $medalsFiltered;
    /**
     * @var AccessSocial
     */
    #[Assert\Valid]
    #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\AccessSocial', mappedBy: 'access', cascade: ['persist'], orphanRemoval: true, fetch: 'EAGER')]
    #[Groups(['access', 'access_mass', 'teachers_list', 'access_details', 'accesses_list', 'student_list', 'guardians_list', 'teachers_list', 'adherent_list', 'personnels_list', 'ca_list', 'othercontact_list', 'board_list', 'fusion_accesses'])]
    private $accessSocial;
    /**
     * @var AccessNetworkSetting
     */
    #[Assert\Valid]
    #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\AccessNetworkSetting', mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true, fetch: 'EAGER')]
    #[Groups(['access', 'accesscmfnetwork', 'access_details', 'student_list', 'guardians_list', 'teachers_list', 'adherent_list', 'personnels_list', 'ca_list', 'accesses_list', 'student_list', 'guardians_list', 'teachers_list', 'adherent_list', 'personnels_list', 'morals_list', 'othercontact_list', 'student_registration', 'board_list', 'own_access', 'access_informations_edit'])]
    private $accessNetworkSetting;
    /**
     * @var ArrayCollection<OrganizationResponsability>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\AccessAndFunction\OrganizationResponsability', mappedBy: 'access', orphanRemoval: true, cascade: ['persist'])]
    #[Groups(['access_organizationresponsability', 'access_details'])]
    private $organizationResponsabilities;
    /**
     * @var string
     */
    #[Groups(['template', 'accesses_list', 'student_list', 'guardians_list', 'teachers_list', 'adherent_list', 'personnels_list', 'ca_list', 'othercontact_list', 'board_list', 'networkmanagers_list'])]
    protected $cmfLicenceTemplate;
    /**
     * @var int
     */
    #[Groups(['access', 'adherent_list', 'student_list', 'guardians_list', 'teachers_list', 'personnels_list', 'ca_list', 'board_list'])]
    private $seniority;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer', nullable: true)]
    #[Groups(['access'])]
    private $activityYear;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['accesses_list', 'access_informations_edit', 'ca_list', 'student_list', 'guardians_list', 'teachers_list', 'adherent_list', 'personnels_list', 'othercontact_list', 'board_list'])]
    private $waitingForValidation = false;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer', nullable: true)]
    private $sharingPersonToRecover;
    /**
     * @var AccessCommunication
     */
    #[Assert\Valid]
    #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\AccessCommunication', mappedBy: 'access', cascade: ['persist'], orphanRemoval: true, fetch: 'EAGER')]
    #[Groups(['access_communication'])]
    private $accessCommunication;
    /**
     * @var ArrayCollection<AccessWish>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\AccessWish\AccessWish', cascade: ['persist', 'remove'], mappedBy: 'accessOriginal', orphanRemoval: true, fetch: 'EAGER')]
    #[Groups(['access_accesswishes', 'online_registration_access_family'])]
    private $accessWishes;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['access', 'access_informations_edit', 'student_registration', 'access_mass'])]
    private $approveRulesProcedure = false;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['access', 'access_informations_edit', 'student_registration'])]
    private $receiveInformationsFromOrganization = false;
    /**
     * @var ArrayCollection<WorkByUser  >
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\WorkByUser', mappedBy: 'student', cascade: ['persist'], orphanRemoval: true)]
    #[Groups(['work'])]
    private $workByUsers;
    /**
     * @var CalendarSynchro
     */
    #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\Booking\CalendarSynchro', mappedBy: 'access', cascade: ['persist'], orphanRemoval: true, fetch: 'EAGER')]
    #[Groups(['access_calendarsynchro'])]
    private $calendarSynchro;
    /**
     * @var ArrayCollection<Tag>
     */
    #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Core\Tagg', cascade: ['persist'], inversedBy: 'accesses')]
    #[ORM\JoinTable(name: 'tag_access', joinColumns: [], inverseJoinColumns: [])]
    #[ORM\JoinColumn(name: 'access_id', referencedColumnName: 'id')]
    #[ORM\JoinColumn(name: 'tag_id', referencedColumnName: 'id')]
    #[Assert\Valid]
    #[Groups(['access_tags', 'manage_tags', 'student_list', 'access_informations_edit', 'guardians_list', 'teachers_list', 'adherent_list', 'personnels_list', 'board_list', 'ca_list', 'morals_list', 'othercontact_list', 'accesses_list', 'student_registration', 'education_student_next_year_access', 'accesses_no_reregistred_list', 'equipmentloan_list_borrower', 'equipmentrent_list_borrower', 'education_input_list_access', 'educationnotation_list_educationstudent', 'examenconvocation_list_student', 'access_intangible_list_access', 'billaccounting_list_billlines', 'billaccounting_list_bill', 'bill_list_billlines', 'billcredit_list_bill', 'education_student_wish_list_accesswishreregistrations', 'education_student_next_year_edit_access', 'payer_list_billingpayers', 'billpayment_list_bill', 'online_registration_validation_accessoriginal', 'payer_list', 'attendancebooking_list_access', 'attendance_list_access'])]
    private $tags;
    /**
     * @var EducationNotationConfig
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Education\EducationNotationConfig', inversedBy: 'teachers')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    #[Groups(['access', 'access_reference'])]
    private $educationNotationConfig;
    /**
     * @var Parameters
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Organization\Parameters', inversedBy: 'publicationDirectors')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true)]
    private $publicationDirector;
    public function __construct()
    {
        $this->guardians = new ArrayCollection();
        $this->children = new ArrayCollection();
        $this->companyPersonAccesses = new ArrayCollection();
        $this->companyPersonCompany = new ArrayCollection();
        $this->educationStudent = new ArrayCollection();
        $this->educationTeachers = new ArrayCollection();
        $this->organizationFunction = new ArrayCollection();
        $this->personActivity = new ArrayCollection();
        $this->personActivityActive = new ArrayCollection();
        $this->holidays = new ArrayCollection();
        $this->courses = new ArrayCollection();
        $this->educationStudentByTeacher = new ArrayCollection();
        $this->billingPayers = new ArrayCollection();
        $this->billingReceivers = new ArrayCollection();
        $this->accessIntangibles = new ArrayCollection();
        $this->billingEducationalProjectPayers = new ArrayCollection();
        $this->bills = new ArrayCollection();
        $this->billLines = new ArrayCollection();
        $this->silentPartners = new ArrayCollection();
        $this->operationalPartners = new ArrayCollection();
        $this->eventUsers = new ArrayCollection();
        $this->examenConvocations = new ArrayCollection();
        $this->equipmentRepairProviders = new ArrayCollection();
        $this->roomRepairProviders = new ArrayCollection();
        $this->placeRepairProviders = new ArrayCollection();
        $this->documentAuthors = new ArrayCollection();
        $this->notifications = new ArrayCollection();
        $this->notificationUsers = new ArrayCollection();
        $this->messages = new ArrayCollection();
        $this->juryMembers = new ArrayCollection();
        $this->organizationContacts = new ArrayCollection();
        $this->organizationLicences = new ArrayCollection();
        $this->commissionMembers = new ArrayCollection();
        $this->equipmentSuppliers = new ArrayCollection();
        $this->equipmentControlManagers = new ArrayCollection();
        $this->equipmentEditors = new ArrayCollection();
        $this->equipmentLoans = new ArrayCollection();
        $this->accompanistControl = new ArrayCollection();
        $this->equipments= new ArrayCollection();
        $this->childrenContactReferences = new ArrayCollection();
        $this->accessFictionalIntangibles = new ArrayCollection();
        $this->personalizedLists = new ArrayCollection();
        $this->practicalCourses = new ArrayCollection();
        $this->attendances = new ArrayCollection();
        $this->attendanceBookings = new ArrayCollection();
        $this->attendanceBookingsFiltered = new ArrayCollection();
        $this->attendanceReplacements = new ArrayCollection();
        $this->donors= new ArrayCollection();
        $this->donorsFiltered= new ArrayCollection();
        $this->medals= new ArrayCollection();
        $this->medalsFiltered= new ArrayCollection();
        $this->organizationResponsabilities= new ArrayCollection();
        $this->coursesFiltered= new ArrayCollection();
        $this->tags= 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 person.
     *
     * @param Person $person
     *
     * @return $this
     */
    public function setPerson(Person $person)
    {
        $this->person = $person;

        return $this;
    }
    /**
     * Gets person.
     *
     * @return Person
     */
    public function getPerson()
    {
        return $this->person;
    }
    /**
     * Sets organization.
     *
     * @param Organization $organization
     *
     * @return $this
     */
    public function setOrganization(Organization $organization)
    {
        $this->organization = $organization;

        return $this;
    }
    /**
     * Gets organization.
     *
     * @return Organization
     */
    public function getOrganization()
    {
        return $this->organization;
    }
    /**
     * Sets adminAccess.
     *
     * @param bool $adminAccess
     *
     * @return $this
     */
    public function setAdminAccess($adminAccess)
    {
        $this->adminAccess = $adminAccess;

        return $this;
    }
    /**
     * Gets adminAccess.
     *
     * @return bool
     */
    public function getAdminAccess()
    {
        return $this->adminAccess;
    }
    /**
     * add role.
     *
     * @param string $role
     *
     * @return $this
     */
    public function addRole($role)
    {

        $this->roles[] = $role;

        return $this;
    }
    /**
     * Sets roles.
     *
     * @param array $roles
     *
     * @return $this
     */
    public function setRoles(array $roles)
    {

        $this->roles = $roles;

        return $this;
    }
    /**
     * Gets roles.
     *
     * @return array
     */
    public function getRoles()
    {
        return $this->roles;
    }
    /**
     * Set personalized roles
     *
     * @param boolean $personalizedRoles
     *
     * @return Access
     */
    public function setPersonalizedRoles($personalizedRoles)
    {
        $this->personalizedRoles = $personalizedRoles;

        return $this;
    }
    /**
     * Get personalized roles
     *
     * @return boolean
     */
    public function getPersonalizedRoles()
    {
        return $this->personalizedRoles;
    }
    /**
     * Add course
     *
     * @param \AppBundle\Entity\Booking\Course $course
     *
     * @return Access
     */
    public function addCourse(\AppBundle\Entity\Booking\Course $course)
    {
        $this->courses[] = $course;
        return $this;
    }
    /**
     * Remove course
     *
     * @param \AppBundle\Entity\Booking\Course $course
     */
    public function removeCourse(\AppBundle\Entity\Booking\Course $course)
    {
        $course->removeStudent($this);
        $this->courses->removeElement($course);
    }
    /**
     * Get courses
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getCourses()
    {
        return $this->courses;
    }
    /**
     * Get educationStudentByTeacher
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEducationStudentByTeacher()
    {
        return $this->educationStudentByTeacher;
    }
    /**
     * Add educationStudentByTeacher
     *
     * @param \AppBundle\Entity\Education\EducationStudent $educationStudentByTeacher
     *
     * @return Access
     */
    public function addEducationStudentByTeacher(\AppBundle\Entity\Education\EducationStudent $educationStudentByTeacher)
    {
        $this->educationStudentByTeacher[] = $educationStudentByTeacher;

        return $this;
    }
    /**
     * Remove educationStudentByTeacher
     *
     * @param \AppBundle\Entity\Education\EducationStudent $educationStudentByTeacher
     */
    public function removeEducationStudentByTeacher(\AppBundle\Entity\Education\EducationStudent $educationStudentByTeacher)
    {
        $this->educationStudentByTeacher->removeElement($educationStudentByTeacher);
    }
    /**
     * Add practical course
     *
     * @param \AppBundle\Entity\Booking\Course $course
     *
     * @return Access
     */
    public function addPracticalCourse(\AppBundle\Entity\Booking\Course $course)
    {
        $this->practicalCourses[] = $course;
        return $this;
    }
    /**
     * Remove practical course
     *
     * @param \AppBundle\Entity\Booking\Course $course
     */
    public function removePracticalCourse(\AppBundle\Entity\Booking\Course $course)
    {
        $course->removeStudent($this);
        $this->practicalCourses->removeElement($course);
    }
    /**
     * Get practical courses
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getPracticalCourses()
    {
        return $this->practicalCourses;
    }
    public function getBookingOrganizers()
    {
        return $this->bookingOrganizers;
    }
    public function removeBookingOrganizer(\AppBundle\Entity\Booking\AbstractBooking $booking)
    {
        $this->bookingOrganizers->removeElement($booking);
    }
    public function addBookingOrganizer(\AppBundle\Entity\Booking\AbstractBooking $booking)
    {
        $this->bookingOrganizers[] = $booking;
        return $this;
    }
    /**
     * Set accessBilling
     *
     * @param \AppBundle\Entity\Billing\AccessBilling $accessBilling
     *
     * @return Access
     */
    public function setAccessBilling(\AppBundle\Entity\Billing\AccessBilling $accessBilling = null)
    {
        if(!is_null($accessBilling)){
            $accessBilling->setAccess($this);
        }
        $this->accessBilling = $accessBilling;

        return $this;
    }
    /**
     * Get accessBilling
     *
     * @return \AppBundle\Entity\Billing\AccessBilling
     */
    public function getAccessBilling()
    {
        return $this->accessBilling;
    }
    /**
     * Add holiday
     *
     * @param \AppBundle\Entity\Booking\PersonHoliday $holiday
     *
     * @return Access
     */
    public function addHoliday(\AppBundle\Entity\Booking\PersonHoliday $holiday)
    {
        $this->holidays[] = $holiday;

        return $this;
    }
    /**
     * Remove holiday
     *
     * @param \AppBundle\Entity\Booking\PersonHoliday $holiday
     */
    public function removeHoliday(\AppBundle\Entity\Booking\PersonHoliday $holiday)
    {
        $this->holidays->removeElement($holiday);
    }
    /**
     * Get holidays
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getHolidays()
    {
        return $this->holidays;
    }
    /**
     * Set AccessFamily
     *
     * @param AccessFamily $accessFamily
     *
     * @return Access
     */
    public function setAccessFamily(AccessFamily $accessFamily = null)
    {
        $this->accessFamily = $accessFamily;
        return $this;
    }
    /**
     * Get AccessFamily
     *
     * @return AccessFamily
     */
    public function getAccessFamily()
    {
        return $this->accessFamily;
    }
    /**
     * Get AccessFamily
     *
     * @return AccessFamily
     */
    public function getFamilyMembers()
    {
        $family = [];

        $accesses = $this->accessFamily ? $this->accessFamily->getAccesses() : [];
        foreach ($accesses as $access) {
            $currentAccess = [];
//            $scriptName = strpos($_SERVER['SCRIPT_NAME'], 'dev') ? '' : $_SERVER['SCRIPT_NAME'];
            $currentAccess['access'] = "/api/accesses/".$access->getId();
            $contactPoints = [];
            foreach($access->getPerson()->getContactPoint() as $key => $contactPoint){
                $contactPoints[$key]['contactType'] = $contactPoint->getContactType();
                $contactPoints[$key]['email'] = $contactPoint->getEmail();
                $contactPoints[$key]['telphone'] = $contactPoint->getTelphone();
                $contactPoints[$key]['mobilPhone'] = $contactPoint->getMobilPhone();
            }
            $personAddressPostals = [];
            foreach($access->getPerson()->getPersonAddressPostal() as $key => $personAddressPostal){
                $personAddressPostals[$key]['type'] = $personAddressPostal->getType();
                $personAddressPostals[$key]['addressPostal']['streetAddress'] = $personAddressPostal->getAddressPostal()->getStreetAddress();
                $personAddressPostals[$key]['addressPostal']['postalCode'] = $personAddressPostal->getAddressPostal()->getPostalCode();
                $personAddressPostals[$key]['addressPostal']['addressCity'] = $personAddressPostal->getAddressPostal()->getAddressCity();
            }

            $currentAccess['accessDetail'] = ['person' => ['contactPoint' => $contactPoints, 'personAddressPostal' => $personAddressPostals]];

            $family[] = $currentAccess;
        }
        return $family;
    }
    /**
     * @param CompanyPerson $companyPerson
     * @return $this
     */
    public function addCompanyPersonAccess(CompanyPerson $companyPerson)
    {
        $companyPerson->setCompany($this);
        $this->companyPersonAccesses[] = $companyPerson;

        return $this;
    }
    /**
     * Remove companyPersonAccess
     *
     * @param \AppBundle\Entity\Person\CompanyPerson $companyPersonAccess
     */
    public function removeCompanyPersonAccess(\AppBundle\Entity\Person\CompanyPerson $companyPersonAccess)
    {
        $this->companyPersonAccesses->removeElement($companyPersonAccess);
    }
    /**
     * @param CompanyPerson $companyPerson
     * @return $this
     */
    public function addCompanyPersonCompany(CompanyPerson $companyPerson)
    {

        $companyPerson->setAccess($this);
        $this->companyPersonCompany[] = $companyPerson;

        return $this;
    }
    /**
     * Get companyPersonAccesses
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getCompanyPersonAccesses()
    {
        return $this->companyPersonAccesses;
    }
    /**
     * @return ArrayCollection
     */
    public function getCompanyPersonCompany()
    {
        return $this->companyPersonCompany;
    }
    /**
     * Remove companyPersonCompany
     *
     * @param \AppBundle\Entity\Person\CompanyPerson $companyPersonCompany
     */
    public function removeCompanyPersonCompany(\AppBundle\Entity\Person\CompanyPerson $companyPersonCompany)
    {
        $this->companyPersonCompany->removeElement($companyPersonCompany);
    }
    /**
     * @param EducationStudent $educationStudent
     * @return $this
     */
    public function addEducationStudent(EducationStudent $educationStudent)
    {

        $educationStudent->setAccess($this);
        $this->educationStudent[] = $educationStudent;

        return $this;
    }
    /**
     * @return ArrayCollection
     */
    public function getEducationStudent()
    {
        return $this->educationStudent;
    }
    /**
     * Remove educationStudent
     *
     * @param \AppBundle\Entity\Education\EducationStudent $educationStudent
     */
    public function removeEducationStudent(\AppBundle\Entity\Education\EducationStudent $educationStudent)
    {
        $this->educationStudent->removeElement($educationStudent);
    }
    /**
     * @param OrganizationFunction $organizationFunction
     * @return $this
     */
    public function addOrganizationFunction(OrganizationFunction $organizationFunction)
    {

        $organizationFunction->setAccess($this);
        $this->organizationFunction[] = $organizationFunction;

        return $this;
    }
    /**
     * @return ArrayCollection
     */
    public function getOrganizationFunction()
    {
        return $this->organizationFunction;
    }
    /**
     * Remove organizationFunction
     *
     * @param \AppBundle\Entity\AccessAndFunction\OrganizationFunction $organizationFunction
     */
    public function removeOrganizationFunction(\AppBundle\Entity\AccessAndFunction\OrganizationFunction $organizationFunction)
    {
        $this->organizationFunction->removeElement($organizationFunction);
    }
    /**
     * @param PersonActivity $personActivity
     * @return $this
     */
    public function addPersonActivity(PersonActivity $personActivity)
    {

        $personActivity->setAccess($this);
        $this->personActivity[] = $personActivity;

        return $this;
    }
    /**
     * @return ArrayCollection
     */
    public function getPersonActivity()
    {
        return $this->personActivity;
    }
    /**
     * @return ArrayCollection
     */
    public function getPersonActivityActive()
    {
        $filtered = array_filter($this->personActivityActive->toArray(), function($personActivityActive) {
            return new \DateTime($personActivityActive->getStartDate()) <= new \DateTime() && new \DateTime($personActivityActive->getEndDate()) >= new \DateTime();
        });
        $filteredArray = new ArrayCollection(array_values($filtered));
        return $filteredArray;
    }
    /**
     * Remove personActivity
     *
     * @param \AppBundle\Entity\Person\PersonActivity $personActivity
     */
    public function removePersonActivity(\AppBundle\Entity\Person\PersonActivity $personActivity)
    {
        $this->personActivity->removeElement($personActivity);
    }
    /**
     * Add billingReceiver
     *
     * @param \AppBundle\Entity\Billing\AccessPayer $billingReceiver
     *
     * @return Access
     */
    public function addBillingReceiver(\AppBundle\Entity\Billing\AccessPayer $billingReceiver)
    {
        $billingReceiver->setAccessReceiver($this);
        $this->billingReceivers[] = $billingReceiver;

        return $this;
    }
    /**
     * Remove billingReceiver
     *
     * @param \AppBundle\Entity\Billing\AccessPayer $billingReceiver
     */
    public function removeBillingReceiver(\AppBundle\Entity\Billing\AccessPayer $billingReceiver)
    {
        $this->billingReceivers->removeElement($billingReceiver);
    }
    /**
     * Get billingReceivers
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getBillingReceivers()
    {
        return $this->billingReceivers;
    }
    /**
     * Add billingPayer
     *
     * @param \AppBundle\Entity\Billing\AccessPayer $billingPayer
     *
     * @return Access
     */
    public function addBillingPayer(\AppBundle\Entity\Billing\AccessPayer $billingPayer)
    {
        $billingPayer->setAccessPayer($this);
        $this->billingPayers[] = $billingPayer;

        return $this;
    }
    /**
     * Remove billingPayer
     *
     * @param \AppBundle\Entity\Billing\AccessPayer $billingPayer
     */
    public function removeBillingPayer(\AppBundle\Entity\Billing\AccessPayer $billingPayer)
    {
        $this->billingPayers->removeElement($billingPayer);
    }
    /**
     * Get billingPayers
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getBillingPayers()
    {
        return $this->billingPayers;
    }
    /**
     * Add accessIntangible
     *
     * @param \AppBundle\Entity\Billing\AccessIntangible $accessIntangible
     *
     * @return Access
     */
    public function addAccessIntangible(\AppBundle\Entity\Billing\AccessIntangible $accessIntangible)
    {
        $accessIntangible->setAccess($this);
        $this->accessIntangibles[] = $accessIntangible;

        return $this;
    }
    /**
     * Remove accessIntangible
     *
     * @param \AppBundle\Entity\Billing\AccessIntangible $accessIntangible
     */
    public function removeAccessIntangible(\AppBundle\Entity\Billing\AccessIntangible $accessIntangible)
    {
        $this->accessIntangibles->removeElement($accessIntangible);
    }
    /**
     * Get accessIntangibles
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getAccessIntangibles()
    {
        return $this->accessIntangibles;
    }
    /**
     * Add billingEducationalProjectPayer
     *
     * @param \AppBundle\Entity\Billing\EducationalProjectPayer $billingEducationalProjectPayer
     *
     * @return Access
     */
    public function addBillingEducationalProjectPayer(\AppBundle\Entity\Billing\EducationalProjectPayer $billingEducationalProjectPayer)
    {
        $this->billingEducationalProjectPayers[] = $billingEducationalProjectPayer;

        return $this;
    }
    /**
     * Remove billingEducationalProjectPayer
     *
     * @param \AppBundle\Entity\Billing\EducationalProjectPayer $billingEducationalProjectPayer
     */
    public function removeBillingEducationalProjectPayer(\AppBundle\Entity\Billing\EducationalProjectPayer $billingEducationalProjectPayer)
    {
        $this->billingEducationalProjectPayers->removeElement($billingEducationalProjectPayer);
    }
    /**
     * Get billingEducationalProjectPayers
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getBillingEducationalProjectPayers()
    {
        return $this->billingEducationalProjectPayers;
    }
    /**
     * Add bill
     *
     * @param \AppBundle\Entity\Billing\Bill $bill
     *
     * @return Access
     */
    public function addBill(\AppBundle\Entity\Billing\Bill $bill)
    {
        $this->bills[] = $bill;

        return $this;
    }
    /**
     * Remove bill
     *
     * @param \AppBundle\Entity\Billing\Bill $bill
     */
    public function removeBill(\AppBundle\Entity\Billing\Bill $bill)
    {
        $this->bills->removeElement($bill);
    }
    /**
     * Get bills
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getBills()
    {
        return $this->bills;
    }
    /**
     * Add billLine
     *
     * @param \AppBundle\Entity\Billing\BillLine $billLine
     *
     * @return Access
     */
    public function addBillLine(\AppBundle\Entity\Billing\BillLine $billLine)
    {
        $this->billLines[] = $billLine;

        return $this;
    }
    /**
     * Remove billLine
     *
     * @param \AppBundle\Entity\Billing\BillLine $billLine
     */
    public function removeBillLine(\AppBundle\Entity\Billing\BillLine $billLine)
    {
        $this->billLines->removeElement($billLine);
    }
    /**
     * Get billLines
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getBillLines()
    {
        return $this->billLines;
    }
    /**
     * Add silentPartner
     *
     * @param \AppBundle\Entity\Booking\EducationalProject $silentPartner
     *
     * @return Access
     */
    public function addSilentPartner(\AppBundle\Entity\Booking\EducationalProject $silentPartner)
    {
        $this->silentPartners[] = $silentPartner;

        return $this;
    }
    /**
     * Remove silentPartner
     *
     * @param \AppBundle\Entity\Booking\EducationalProject $silentPartner
     */
    public function removeSilentPartner(\AppBundle\Entity\Booking\EducationalProject $silentPartner)
    {
        $this->silentPartners->removeElement($silentPartner);
    }
    /**
     * Get silentPartners
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getSilentPartners()
    {
        return $this->silentPartners;
    }
    /**
     * Add operationalPartner
     *
     * @param \AppBundle\Entity\Booking\EducationalProject $operationalPartner
     *
     * @return Access
     */
    public function addOperationalPartner(\AppBundle\Entity\Booking\EducationalProject $operationalPartner)
    {
        $this->operationalPartners[] = $operationalPartner;

        return $this;
    }
    /**
     * Remove operationalPartner
     *
     * @param \AppBundle\Entity\Booking\EducationalProject $operationalPartner
     */
    public function removeOperationalPartner(\AppBundle\Entity\Booking\EducationalProject $operationalPartner)
    {
        $this->operationalPartners->removeElement($operationalPartner);
    }
    /**
     * Get operationalPartners
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getOperationalPartners()
    {
        return $this->operationalPartners;
    }
    /**
     * Add eventUser
     *
     * @param \AppBundle\Entity\Booking\EventUser $eventUser
     *
     * @return Access
     */
    public function addEventUser(\AppBundle\Entity\Booking\EventUser $eventUser)
    {
        $this->eventUsers[] = $eventUser;

        return $this;
    }
    /**
     * Remove eventUser
     *
     * @param \AppBundle\Entity\Booking\EventUser $eventUser
     */
    public function removeEventUser(\AppBundle\Entity\Booking\EventUser $eventUser)
    {
        $this->eventUsers->removeElement($eventUser);
    }
    /**
     * Get eventUsers
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEventUsers()
    {
        return $this->eventUsers;
    }
    /**
     * Add examenConvocation
     *
     * @param \AppBundle\Entity\Booking\ExamenConvocation $examenConvocation
     *
     * @return Access
     */
    public function addExamenConvocation(\AppBundle\Entity\Booking\ExamenConvocation $examenConvocation)
    {
        $this->examenConvocations[] = $examenConvocation;

        return $this;
    }
    /**
     * Remove examenConvocation
     *
     * @param \AppBundle\Entity\Booking\ExamenConvocation $examenConvocation
     */
    public function removeExamenConvocation(\AppBundle\Entity\Booking\ExamenConvocation $examenConvocation)
    {
        $this->examenConvocations->removeElement($examenConvocation);
    }
    /**
     * Get examenConvocations
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getExamenConvocations()
    {
        return $this->examenConvocations;
    }
    /**
     * Add educationTeacher
     *
     * @param \AppBundle\Entity\Education\EducationTeacher $educationTeacher
     *
     * @return Access
     */
    public function addEducationTeacher(\AppBundle\Entity\Education\EducationTeacher $educationTeacher)
    {
        $this->educationTeachers[] = $educationTeacher;

        return $this;
    }
    /**
     * Remove educationTeacher
     *
     * @param \AppBundle\Entity\Education\EducationTeacher $educationTeacher
     */
    public function removeEducationTeacher(\AppBundle\Entity\Education\EducationTeacher $educationTeacher)
    {
        $this->educationTeachers->removeElement($educationTeacher);
    }
    /**
     * Get educationTeachers
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEducationTeachers()
    {
        return $this->educationTeachers;
    }
    /**
     * Add equipmentRepairProvider
     *
     * @param \AppBundle\Entity\Product\EquipmentRepair $equipmentRepairProvider
     *
     * @return Access
     */
    public function addEquipmentRepairProvider(\AppBundle\Entity\Product\EquipmentRepair $equipmentRepairProvider)
    {
        $this->equipmentRepairProviders[] = $equipmentRepairProvider;

        return $this;
    }
    /**
     * Remove equipmentRepairProvider
     *
     * @param \AppBundle\Entity\Product\EquipmentRepair $equipmentRepairProvider
     */
    public function removeEquipmentRepairProvider(\AppBundle\Entity\Product\EquipmentRepair $equipmentRepairProvider)
    {
        $this->equipmentRepairProviders->removeElement($equipmentRepairProvider);
    }
    /**
     * Get equipmentRepairProviders
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEquipmentRepairProviders()
    {
        return $this->equipmentRepairProviders;
    }
    /**
     * Add roomRepairProvider
     *
     * @param \AppBundle\Entity\Place\RoomRepair $roomRepairProvider
     *
     * @return Access
     */
    public function addRoomRepairProvider(\AppBundle\Entity\Place\RoomRepair $roomRepairProvider)
    {
        $this->roomRepairProviders[] = $roomRepairProvider;

        return $this;
    }
    /**
     * Remove roomRepairProvider
     *
     * @param \AppBundle\Entity\Place\RoomRepair $roomRepairProvider
     */
    public function removeRoomRepairProvider(\AppBundle\Entity\Place\RoomRepair $roomRepairProvider)
    {
        $this->roomRepairProviders->removeElement($roomRepairProvider);
    }
    /**
     * Get roomRepairProviders
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getRoomRepairProviders()
    {
        return $this->roomRepairProviders;
    }
    /**
     * Add placeRepairProvider
     *
     * @param \AppBundle\Entity\Place\PlaceRepair $placeRepairProvider
     *
     * @return Access
     */
    public function addPlaceRepairProvider(\AppBundle\Entity\Place\PlaceRepair $placeRepairProvider)
    {
        $this->placeRepairProviders[] = $placeRepairProvider;

        return $this;
    }
    /**
     * Remove placeRepairProvider
     *
     * @param \AppBundle\Entity\Place\PlaceRepair $placeRepairProvider
     */
    public function removePlaceRepairProvider(\AppBundle\Entity\Place\PlaceRepair $placeRepairProvider)
    {
        $this->placeRepairProviders->removeElement($placeRepairProvider);
    }
    /**
     * Get placeRepairProviders
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getPlaceRepairProviders()
    {
        return $this->placeRepairProviders;
    }
    /**
     * Add documentAuthor
     *
     * @param \AppBundle\Entity\Core\Document $documentAuthor
     *
     * @return Access
     */
    public function addDocumentAuthor(\AppBundle\Entity\Core\Document $documentAuthor)
    {
        $this->documentAuthors[] = $documentAuthor;

        return $this;
    }
    /**
     * Remove documentAuthor
     *
     * @param \AppBundle\Entity\Core\Document $documentAuthor
     */
    public function removeDocumentAuthor(\AppBundle\Entity\Core\Document $documentAuthor)
    {
        $this->documentAuthors->removeElement($documentAuthor);
    }
    /**
     * Get documentAuthors
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getDocumentAuthors()
    {
        return $this->documentAuthors;
    }
    /**
     * Add notification
     *
     * @param \AppBundle\Entity\Core\Notification $notification
     *
     * @return Access
     */
    public function addNotification(\AppBundle\Entity\Core\Notification $notification)
    {
        $this->notifications[] = $notification;

        return $this;
    }
    /**
     * Remove notification
     *
     * @param \AppBundle\Entity\Core\Notification $notification
     */
    public function removeNotification(\AppBundle\Entity\Core\Notification $notification)
    {
        $this->notifications->removeElement($notification);
    }
    /**
     * Get notifications
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getNotifications()
    {
        return $this->notifications;
    }
    /**
     * Add notificationUser
     *
     * @param \AppBundle\Entity\Core\NotificationUser $notificationUser
     *
     * @return Access
     */
    public function addNotificationUser(\AppBundle\Entity\Core\NotificationUser $notificationUser)
    {
        $this->notificationUsers[] = $notificationUser;

        return $this;
    }
    /**
     * Remove notificationUser
     *
     * @param \AppBundle\Entity\Core\NotificationUser $notificationUser
     */
    public function removeNotificationUser(\AppBundle\Entity\Core\NotificationUser $notificationUser)
    {
        $this->notificationUsers->removeElement($notificationUser);
    }
    /**
     * Get notificationUsers
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getNotificationUsers()
    {
        return $this->notificationUsers;
    }
    /**
     * Add message
     *
     * @param \AppBundle\Entity\Message\Message $message
     *
     * @return Access
     */
    public function addMessage(\AppBundle\Entity\Message\Message $message)
    {
        $this->messages[] = $message;

        return $this;
    }
    /**
     * Remove message
     *
     * @param \AppBundle\Entity\Message\Message $message
     */
    public function removeMessage(\AppBundle\Entity\Message\Message $message)
    {
        $this->messages->removeElement($message);
    }
    /**
     * Get messages
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getMessages()
    {
        return $this->messages;
    }
    /**
     * Add juryMember
     *
     * @param \AppBundle\Entity\Organization\Jury $juryMember
     *
     * @return Access
     */
    public function addJuryMember(\AppBundle\Entity\Organization\Jury $juryMember)
    {
        $this->juryMembers[] = $juryMember;

        return $this;
    }
    /**
     * Remove juryMember
     *
     * @param \AppBundle\Entity\Organization\Jury $juryMember
     */
    public function removeJuryMember(\AppBundle\Entity\Organization\Jury $juryMember)
    {
        $this->juryMembers->removeElement($juryMember);
    }
    /**
     * Get juryMembers
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getJuryMembers()
    {
        return $this->juryMembers;
    }
    /**
     * Add organizationContact
     *
     * @param \AppBundle\Entity\Organization\Organization $organizationContact
     *
     * @return Access
     */
    public function addOrganizationContact(\AppBundle\Entity\Organization\Organization $organizationContact)
    {
        $this->organizationContacts[] = $organizationContact;

        return $this;
    }
    /**
     * Remove organizationContact
     *
     * @param \AppBundle\Entity\Organization\Organization $organizationContact
     */
    public function removeOrganizationContact(\AppBundle\Entity\Organization\Organization $organizationContact)
    {
        $this->organizationContacts->removeElement($organizationContact);
    }
    /**
     * Get organizationContacts
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getOrganizationContacts()
    {
        return $this->organizationContacts;
    }
    /**
     * Add organizationLicence
     *
     * @param \AppBundle\Entity\Organization\OrganizationLicence $organizationLicence
     *
     * @return Access
     */
    public function addOrganizationLicence(\AppBundle\Entity\Organization\OrganizationLicence $organizationLicence)
    {
        $this->organizationLicences[] = $organizationLicence;

        return $this;
    }
    /**
     * Remove organizationLicence
     *
     * @param \AppBundle\Entity\Organization\OrganizationLicence $organizationLicence
     */
    public function removeOrganizationLicence(\AppBundle\Entity\Organization\OrganizationLicence $organizationLicence)
    {
        $this->organizationLicences->removeElement($organizationLicence);
    }
    /**
     * Get organizationLicences
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getOrganizationLicences()
    {
        return $this->organizationLicences;
    }
    /**
     * Add commissionMember
     *
     * @param \AppBundle\Entity\Person\CommissionMember $commissionMember
     *
     * @return Access
     */
    public function addCommissionMember(\AppBundle\Entity\Person\CommissionMember $commissionMember)
    {
        $this->commissionMembers[] = $commissionMember;

        return $this;
    }
    /**
     * Remove commissionMember
     *
     * @param \AppBundle\Entity\Person\CommissionMember $commissionMember
     */
    public function removeCommissionMember(\AppBundle\Entity\Person\CommissionMember $commissionMember)
    {
        $this->commissionMembers->removeElement($commissionMember);
    }
    /**
     * Get commissionMembers
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getCommissionMembers()
    {
        return $this->commissionMembers;
    }
    /**
     * Add equipmentSupplier
     *
     * @param \AppBundle\Entity\Product\Equipment $equipmentSupplier
     *
     * @return Access
     */
    public function addEquipmentSupplier(\AppBundle\Entity\Product\Equipment $equipmentSupplier)
    {
        $this->equipmentSuppliers[] = $equipmentSupplier;

        return $this;
    }
    /**
     * Remove equipmentSupplier
     *
     * @param \AppBundle\Entity\Product\Equipment $equipmentSupplier
     */
    public function removeEquipmentSupplier(\AppBundle\Entity\Product\Equipment $equipmentSupplier)
    {
        $this->equipmentSuppliers->removeElement($equipmentSupplier);
    }
    /**
     * Get equipmentSuppliers
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEquipmentSuppliers()
    {
        return $this->equipmentSuppliers;
    }
    /**
     * Add equipmentControlManager
     *
     * @param \AppBundle\Entity\Product\Equipment $equipmentControlManager
     *
     * @return Access
     */
    public function addEquipmentControlManager(\AppBundle\Entity\Product\Equipment $equipmentControlManager)
    {
        $this->equipmentControlManagers[] = $equipmentControlManager;

        return $this;
    }
    /**
     * Remove equipmentControlManager
     *
     * @param \AppBundle\Entity\Product\Equipment $equipmentControlManager
     */
    public function removeEquipmentControlManager(\AppBundle\Entity\Product\Equipment $equipmentControlManager)
    {
        $this->equipmentControlManagers->removeElement($equipmentControlManager);
    }
    /**
     * Get equipmentControlManagers
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEquipmentControlManagers()
    {
        return $this->equipmentControlManagers;
    }
    /**
     * Add equipmentEditor
     *
     * @param \AppBundle\Entity\Product\Equipment $equipmentEditor
     *
     * @return Access
     */
    public function addEquipmentEditor(\AppBundle\Entity\Product\Equipment $equipmentEditor)
    {
        $this->equipmentEditors[] = $equipmentEditor;

        return $this;
    }
    /**
     * Remove equipmentEditor
     *
     * @param \AppBundle\Entity\Product\Equipment $equipmentEditor
     */
    public function removeEquipmentEditor(\AppBundle\Entity\Product\Equipment $equipmentEditor)
    {
        $this->equipmentEditors->removeElement($equipmentEditor);
    }
    /**
     * Get equipmentEditors
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEquipmentEditors()
    {
        return $this->equipmentEditors;
    }
    /**
     * Add equipmentLoan
     *
     * @param \AppBundle\Entity\Product\EquipmentLoan $equipmentLoan
     *
     * @return Access
     */
    public function addEquipmentLoan(\AppBundle\Entity\Product\EquipmentLoan $equipmentLoan)
    {
        $equipmentLoan->setBorrower($this);
        $this->equipmentLoans[] = $equipmentLoan;

        return $this;
    }
    /**
     * Remove equipmentLoan
     *
     * @param \AppBundle\Entity\Product\EquipmentLoan $equipmentLoan
     */
    public function removeEquipmentLoan(\AppBundle\Entity\Product\EquipmentLoan $equipmentLoan)
    {
        $this->equipmentLoans->removeElement($equipmentLoan);
    }
    /**
     * Get equipmentLoans
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEquipmentLoans()
    {
        return $this->equipmentLoans;
    }
    /**
     * Add accompanistControl
     *
     * @param \AppBundle\Entity\Core\AbstractControl $accompanistControl
     *
     * @return Access
     */
    public function addAccompanistControl(\AppBundle\Entity\Core\AbstractControl $accompanistControl)
    {
        $this->accompanistControl[] = $accompanistControl;

        return $this;
    }
    /**
     * Remove equipmentLoan
     *
     * @param \AppBundle\Entity\Core\AbstractControl $accompanistControl
     */
    public function removeAccompanistControl(\AppBundle\Entity\Core\AbstractControl $accompanistControl)
    {
        $this->accompanistControl->removeElement($accompanistControl);
    }
    /**
     * Get accompanistControl
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getAccompanistControl()
    {
        return $this->accompanistControl;
    }
    /**
     * Add equipment
     *
     * @param \AppBundle\Entity\Product\Equipment $equipment
     *
     * @return Person
     */
    public function addEquipment(\AppBundle\Entity\Product\Equipment $equipment)
    {
        $equipment->setAccess($this);
        $this->equipments[] = $equipment;

        return $this;
    }
    /**
     * Remove equipment
     *
     * @param \AppBundle\Entity\Product\Equipment $equipment
     */
    public function removeEquipment(\AppBundle\Entity\Product\Equipment $equipment)
    {
        $this->equipments->removeElement($equipment);
    }
    /**
     * Get equipments
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEquipments()
    {
        return $this->equipments;
    }
    /**
     * Add guardian
     *
     * @param \AppBundle\Entity\AccessAndFunction\Access $guardian
     *
     * @return Access
     */
    public function addGuardian(\AppBundle\Entity\AccessAndFunction\Access $guardian)
    {
        if(!empty($this->getId()) && $this->getId() === $guardian->getId())
            return $this;

        $guardian->addChild($this);
    $this->guardians[] = $guardian;

        return $this;
    }
    /**
     * Remove guardian
     *
     * @param \AppBundle\Entity\AccessAndFunction\Access $guardian
     */
    public function removeGuardian(\AppBundle\Entity\AccessAndFunction\Access $guardian)
    {
        $guardian->removeChild($this);
        $this->guardians->removeElement($guardian);
    }
    /**
     * Get guardians
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getGuardians()
    {
        return $this->guardians;
    }
    /**
     * Add child
     *
     * @param \AppBundle\Entity\AccessAndFunction\Access $child
     *
     * @return Access
     */
    public function addChild(\AppBundle\Entity\AccessAndFunction\Access $child)
    {
        if(!empty($this->getId()) && $this->getId() === $child->getId())
            return $this;

        $this->children[] = $child;

        return $this;
    }
    /**
     * Remove child
     *
     * @param \AppBundle\Entity\AccessAndFunction\Access $child
     */
    public function removeChild(\AppBundle\Entity\AccessAndFunction\Access $child)
    {
        $this->children->removeElement($child);
    }
    /**
     * Get children
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getChildren()
    {
        return $this->children;
    }
    /**
     * Sets note.
     *
     * @param string $note
     *
     * @return $this
     */
    public function setNote($note)
    {
        $this->note = $note;

        return $this;
    }
    /**
     * Gets note.
     *
     * @return string
     */
    public function getNote()
    {
        return $this->note;
    }
    /**
     * Add accessFictionalIntangible
     *
     * @param \AppBundle\Entity\Billing\AccessFictionalIntangible $accessFictionalIntangible
     *
     * @return Access
     */
    public function addAccessFictionalIntangible(\AppBundle\Entity\Billing\AccessFictionalIntangible $accessFictionalIntangible)
    {
        $this->accessFictionalIntangibles[] = $accessFictionalIntangible;

        return $this;
    }
    /**
     * Remove accessFictionalIntangible
     *
     * @param \AppBundle\Entity\Billing\AccessFictionalIntangible $accessFictionalIntangible
     */
    public function removeAccessFictionalIntangible(\AppBundle\Entity\Billing\AccessFictionalIntangible $accessFictionalIntangible)
    {
        $this->accessFictionalIntangibles->removeElement($accessFictionalIntangible);
    }
    /**
     * Get accessFictionalIntangibles
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getAccessFictionalIntangibles()
    {
        return $this->accessFictionalIntangibles;
    }
    /**
     * Add personalizedList
     *
     * @param \AppBundle\Entity\AccessAndFunction\PersonalizedList $personalizedList
     *
     * @return Access
     */
    public function addPersonalizedList(\AppBundle\Entity\AccessAndFunction\PersonalizedList $personalizedList)
    {
        $this->personalizedLists[] = $personalizedList;

        return $this;
    }
    /**
     * Remove personalizedList
     *
     * @param \AppBundle\Entity\AccessAndFunction\PersonalizedList $personalizedList
     */
    public function removePersonalizedList(\AppBundle\Entity\AccessAndFunction\PersonalizedList $personalizedList)
    {
        $this->personalizedLists->removeElement($personalizedList);
    }
    /**
     * Get personalizedLists
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getPersonalizedLists()
    {
        return $this->personalizedLists;
    }
    /**
     * Set login enabled
     *
     * @param boolean $enabled
     *
     * @return Access
     */
    public function setLoginEnabled($enabled)
    {
        $this->loginEnabled = $enabled;

        return $this;
    }
    /**
     * Get login is enabled
     *
     * @return boolean
     */
    public function getLoginEnabled()
    {
        return $this->loginEnabled;
    }
    /**
     * Get login is enabled
     *
     * @return boolean
     */
    public function isLoginEnabled()
    {
        return $this->loginEnabled;
    }
    /**
     * Set access as a new
     *
     * @param boolean $newAccess
     *
     * @return Access
     */
    public function setNewAccess($newAccess)
    {
        $this->newAccess = $newAccess;

        return $this;
    }
    /**
     * Get status of new access
     *
     * @return boolean
     */
    public function getNewAccess()
    {
        return $this->newAccess;
    }
    /**
     * Set iel enabled
     *
     * @param boolean $ielEnabled
     *
     * @return Access
     */
    public function setIelEnabled($ielEnabled)
    {
        $this->ielEnabled = $ielEnabled;

        return $this;
    }
    /**
     * Get iel enabled
     *
     * @return boolean
     */
    public function getIelEnabled()
    {
        return $this->ielEnabled;
    }
    /**
     * Set iel validation datetime
     *
     * @param \DateTime $ielValidationDatetime
     *
     * @return Access
     */
    public function setIelValidationDatetime($ielValidationDatetime)
    {
        $this->ielValidationDatetime = $ielValidationDatetime;

        return $this;
    }
    /**
     * Get iel validation datetime
     *
     * @return \DateTime
     */
    public function getIelValidationDatetime()
    {
        return $this->ielValidationDatetime;
    }
    /**
     * Is this Access is New ?
     *
     * @return boolean
     */
    public function isNewAccess()
    {
        return $this->newAccess;
    }
    /**
     * Add attendance
     *
     * @param \AppBundle\Entity\Booking\Attendance $attendence
     *
     * @return Organization
     */
    public function addAttendance(\AppBundle\Entity\Booking\Attendance $attendance)
    {
        $attendance->setAccess($this);
        $this->attendances[] = $attendance;

        return $this;
    }
    /**
     * Remove attendance
     *
     * @param \AppBundle\Entity\Booking\Attendance $attendance
     */
    public function removeAttendance(\AppBundle\Entity\Booking\Attendance $attendance)
    {
        $this->attendances->removeElement($attendance);
    }
    /**
     * Get attendances
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getAttendances()
    {
        return $this->attendances;
    }
    /**
     * Add attendanceBooking
     *
     * @param \AppBundle\Entity\Booking\AttendanceBooking $attendanceBooking
     *
     * @return Organization
     */
    public function addAttendanceBooking(\AppBundle\Entity\Booking\AttendanceBooking $attendanceBooking)
    {
        $attendanceBooking->setAccess($this);
        $this->$attendanceBooking[] = $attendanceBooking;

        return $this;
    }
    /**
     * Remove attendanceBooking
     *
     * @param \AppBundle\Entity\Booking\AttendanceBooking $attendanceBooking
     */
    public function removeAttendanceBooking(\AppBundle\Entity\Booking\AttendanceBooking $attendanceBooking)
    {
        $this->attendanceBooking->removeElement($attendanceBooking);
    }
    /**
     * Get attendanceBooking
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getAttendanceBookings()
    {
        return $this->attendanceBookings;
    }
    /**
     * Get attendanceBooking
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getAttendanceBookingsFiltered()
    {
        $filtered = array_filter($this->attendanceBookingsFiltered->toArray(), function($attendanceBookingsFiltered) { return $attendanceBookingsFiltered->getDatetimeStart() <= new \DateTime(); });
        $filteredArray = new ArrayCollection(array_values($filtered));
        return $filteredArray->slice(0,3);
    }
    /**
     * Add $attendanceReplacement
     *
     * @param \AppBundle\Entity\Booking\Attendance $attendanceReplacement
     *
     * @return Organization
     */
    public function addAttendanceReplacement(\AppBundle\Entity\Booking\Attendance $attendanceReplacement)
    {
        $attendanceReplacement->setReplacement($this);
        $this->attendanceReplacements[] = $attendanceReplacement;

        return $this;
    }
    /**
     * Remove $attendanceReplacement
     *
     * @param \AppBundle\Entity\Booking\Attendance $attendanceReplacement
     */
    public function removeAttendanceReplacement(\AppBundle\Entity\Booking\Attendance $attendanceReplacement)
    {
        $this->attendanceReplacements->removeElement($attendanceReplacement);
    }
    /**
     * Get $attendanceReplacements
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getAttendanceReplacements()
    {
        return $this->attendanceReplacements;
    }
    /**
     * Sets setting.
     *
     * @param array $setting
     *
     * @return $this
     */
    public function setSetting(array $setting)
    {
        $this->setting = $setting;
        return $this;
    }
    /**
     * Gets setting.
     *
     * @return array
     */
    public function getSetting()
    {
        return $this->setting;
    }
    /**
     * Add donor
     *
     * @param \AppBundle\Entity\Donor\Donor $donor
     *
     * @return Access
     */
    public function addDonor(\AppBundle\Entity\Donor\Donor $donor)
    {
        $donor->setAccess($this);
        $this->donors[] = $donor;

        return $this;
    }
    /**
     * Remove donor
     *
     * @param \AppBundle\Entity\Donor\Donor $donor
     */
    public function removeDonor(\AppBundle\Entity\Donor\Donor $donor)
    {
        $this->donors->removeElement($donor);
    }
    /**
     * Get donors
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getDonors()
    {
        return $this->donors;
    }
    /**
     * Get donors
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getDonorsFiltered()
    {
        $filtered = array_filter($this->donorsFiltered->toArray(), function($donorsFiltered) {
            return new \DateTime($donorsFiltered->getStartDate()) <= new \DateTime() && (is_null($donorsFiltered->getEndDate()) || new \DateTime($donorsFiltered->getEndDate()) >= new \DateTime());
        });
        $filteredArray = new ArrayCollection(array_values($filtered));
        return $filteredArray->slice(0,3);
    }
    /**
     * Add medal
     *
     * @param \AppBundle\Entity\Person\Medal $medal
     *
     * @return Access
     */
    public function addMedal(Medal $medal)
    {
        $medal->setAccess($this);
        $this->medals[] = $medal;

        return $this;
    }
    /**
     * Remove medal
     *
     * @param \AppBundle\Entity\Person\Medal
     */
    public function removeMedal(Medal $medal)
    {
        $this->medals->removeElement($medal);
    }
    /**
     * Get medals
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getMedals()
    {
        return $this->medals;
    }
    /**
     * Get donors
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getMedalsFiltered()
    {
        return $this->medalsFiltered->slice(0,3);
    }
    /**
     * Set accessSocial
     *
     * @param \AppBundle\Entity\AccessAndFunction\AccessSocial $accessSocial
     *
     * @return Access
     */
    public function setAccessSocial(\AppBundle\Entity\AccessAndFunction\AccessSocial $accessSocial = null)
    {
        if(!is_null($accessSocial)){
            $accessSocial->setAccess($this);
        }
        $this->accessSocial = $accessSocial;

        return $this;
    }
    /**
     * Get accessSocial
     *
     * @return \AppBundle\Entity\AccessAndFunction\AccessSocial
     */
    public function getAccessSocial()
    {
        return $this->accessSocial;
    }
    /**
     * Set accessNetworkSetting
     *
     * @param \AppBundle\Entity\AccessAndFunction\AccessNetworkSetting $accessNetworkSetting
     *
     * @return Access
     */
    public function setAccessNetworkSetting(\AppBundle\Entity\AccessAndFunction\AccessNetworkSetting $accessNetworkSetting = null)
    {
        if(!is_null($accessNetworkSetting)){
            $accessNetworkSetting->setAccess($this);
        }
        $this->accessNetworkSetting = $accessNetworkSetting;

        return $this;
    }
    /**
     * Get accessNetworkSetting
     *
     * @return \AppBundle\Entity\AccessAndFunction\AccessNetworkSetting
     */
    public function getAccessNetworkSetting()
    {
        return $this->accessNetworkSetting;
    }
    /**
     * Add organizationResponsability
     *
     * @param \AppBundle\Entity\AccessAndFunction\OrganizationResponsability $organizationResponsability
     *
     * @return Access
     */
    public function addOrganizationResponsability(\AppBundle\Entity\AccessAndFunction\OrganizationResponsability $organizationResponsability)
    {
        $organizationResponsability->setAccess($this);
        $this->organizationResponsabilities[] = $organizationResponsability;

        return $this;
    }
    /**
     * Remove organizationResponsability
     *
     * @param \AppBundle\Entity\AccessAndFunction\OrganizationResponsability $organizationResponsability
     */
    public function removeOrganizationResponsability(\AppBundle\Entity\AccessAndFunction\OrganizationResponsability $organizationResponsability)
    {
        $this->organizationResponsabilities->removeElement($organizationResponsability);
    }
    /**
     * Get organizationResponsabilities
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getOrganizationResponsabilities()
    {
        return $this->organizationResponsabilities;
    }
    public function getCmfLicenceTemplate(){
        $organization = $this->getOrganization();
        $identifier = $organization->getIdentifier();
        if(is_null($identifier))
            return null;

        return $identifier.$this->getPerson()->getLegacyId();
    }
    /**
     * Gets seniority.
     *
     * @return int
     */
    public function getSeniority()
    {
        $seniority = null;

        $date = null;
        if($this->getAccessNetworkSetting() && $this->getAccessNetworkSetting()->getDateFirstEntry()){
            $date = new \DateTime($this->getAccessNetworkSetting()->getDateFirstEntry());
        }else{
            $firstDate = null;
            foreach($this->getOrganizationFunction() as $organizationFunction){
                $startDate = new \DateTime($organizationFunction->getStartDate());
                if(is_null($firstDate) || new \DateTime($organizationFunction->getStartDate()) < $firstDate){
                    $firstDate = $startDate;
                }
            }
            $date = $firstDate;
        }

        if(!is_null($date)){
            $interval = $date->diff(new \DateTime());
            $seniority = $interval->y;
        }

        return $seniority;
    }
    /**
     * Gets activityYear
     *
     * @return int
     */
    public function getActivityYear() {
        return $this->activityYear;
    }
    /**
     * Sets activityYear
     *
     * @param int $activityYear
     * @return $this
     */
    public function setActivityYear($activityYear) {
        $this->activityYear = $activityYear;
        return $this;
    }
    /**
     * Set waitingForValidation
     *
     * @param boolean $waitingForValidation
     *
     * @return Access
     */
    public function setWaitingForValidation($waitingForValidation)
    {
        $this->waitingForValidation = $waitingForValidation;

        return $this;
    }
    /**
     * Get waitingForValidation
     *
     * @return boolean
     */
    public function getWaitingForValidation()
    {
        return $this->waitingForValidation;
    }
    /**
     * Set sharingPersonToRecover
     *
     * @param integer $sharingPersonToRecover
     *
     * @return Access
     */
    public function setSharingPersonToRecover($sharingPersonToRecover)
    {
        $this->sharingPersonToRecover = $sharingPersonToRecover;

        return $this;
    }
    /**
     * Get sharingPersonToRecover
     *
     * @return integer
     */
    public function getSharingPersonToRecover()
    {
        return $this->sharingPersonToRecover;
    }
    /**
     * Set superAdminAccess
     *
     * @param boolean $superAdminAccess
     *
     * @return Access
     */
    public function setSuperAdminAccess($superAdminAccess)
    {
        $this->superAdminAccess = $superAdminAccess;

        return $this;
    }
    /**
     * Get superAdminAccess
     *
     * @return boolean
     */
    public function getSuperAdminAccess()
    {
        return $this->superAdminAccess;
    }
    /**
     *
     * {@inheritdoc}
     */
    public function getContact() {
        return $this->getPerson();
    }
    /**
     *
     * {@inheritdoc}
     */
    public function getContactAddress() {
        return $this->getContact()->getContactAddress();
    }
    /**
     *
     * {@inheritdoc}
     */
    public function getContactName() {
        return $this->getContact()->getContactName();
    }
    /**
     *
     * {@inheritdoc}
     */
    public function getContactContactPoint() {
        return $this->getContact()->getContactContactPoint();
    }
    /**
     *
     * {@inheritdoc}
     */
    public function getContactPointForType($type) {
        return $this->getContact()->getContactPointForType($type);
    }
    /**
     * Add billCredit
     *
     * @param \AppBundle\Entity\Billing\BillCredit $billCredit
     *
     * @return Access
     */
    public function addBillCredit(\AppBundle\Entity\Billing\BillCredit $billCredit)
    {
        $this->billCredits[] = $billCredit;

        return $this;
    }
    /**
     * Remove billCredit
     *
     * @param \AppBundle\Entity\Billing\BillCredit $billCredit
     */
    public function removeBillCredit(\AppBundle\Entity\Billing\BillCredit $billCredit)
    {
        $this->billCredits->removeElement($billCredit);
    }
    /**
     * Get billCredits
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getBillCredits()
    {
        return $this->billCredits;
    }
    /**
     * Set accessCommunication
     *
     * @param \AppBundle\Entity\AccessAndFunction\AccessCommunication $accessCommunication
     *
     * @return Access
     */
    public function setAccessCommunication(\AppBundle\Entity\AccessAndFunction\AccessCommunication $accessCommunication = null)
    {
        $this->accessCommunication = $accessCommunication;
        $accessCommunication->setAccess($this);
        return $this;
    }
    /**
     * Get accessCommunication
     *
     * @return \AppBundle\Entity\AccessAndFunction\AccessCommunication
     */
    public function getAccessCommunication()
    {
        return $this->accessCommunication;
    }
    /**
     * Set approveRulesProcedure
     *
     * @param boolean $approveRulesProcedure
     *
     * @return Access
     */
    public function setApproveRulesProcedure($approveRulesProcedure)
    {
        $this->approveRulesProcedure = $approveRulesProcedure;

        return $this;
    }
    /**
     * Get approveRulesProcedure
     *
     * @return boolean
     */
    public function getApproveRulesProcedure()
    {
        return $this->approveRulesProcedure;
    }
    /**
     * Set receiveInformationsFromOrganization
     *
     * @param boolean $receiveInformationsFromOrganization
     *
     * @return Access
     */
    public function setReceiveInformationsFromOrganization($receiveInformationsFromOrganization)
    {
        $this->receiveInformationsFromOrganization = $receiveInformationsFromOrganization;

        return $this;
    }
    /**
     * Get receiveInformationsFromOrganization
     *
     * @return boolean
     */
    public function getReceiveInformationsFromOrganization()
    {
        return $this->receiveInformationsFromOrganization;
    }
    /**
     * Get getCoursesFiltered
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getCoursesFiltered()
    {
        $courses = [];
        foreach ($this->getCourses() as $course){
            if(!$course->getIsCanceled() && count($course->getEventRecur()) > 0)
                $courses[] = $course;
        }

        return new ArrayCollection($courses);
    }
    /**
     * Add workByUser
     *
     * @param \AppBundle\Entity\Booking\WorkByUser $workByUser
     *
     * @return Access
     */
    public function addWorkByUser(\AppBundle\Entity\Booking\WorkByUser $workByUser)
    {
        $this->workByUsers[] = $workByUser;

        return $this;
    }
    /**
     * Remove workByUser
     *
     * @param \AppBundle\Entity\Booking\WorkByUser $workByUser
     */
    public function removeWorkByUser(\AppBundle\Entity\Booking\WorkByUser $workByUser)
    {
        $this->workByUsers->removeElement($workByUser);
    }
    /**
     * Get workByUsers
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getWorkByUsers()
    {
        return $this->workByUsers;
    }
    /**
     * Set calendarSynchro
     *
     * @param \AppBundle\Entity\Booking\CalendarSynchro $calendarSynchro
     *
     * @return Access
     */
    public function setCalendarSynchro(\AppBundle\Entity\Booking\CalendarSynchro $calendarSynchro = null)
    {
        $this->calendarSynchro = $calendarSynchro;

        return $this;
    }
    /**
     * Get calendarSynchro
     *
     * @return \AppBundle\Entity\Booking\CalendarSynchro
     */
    public function getCalendarSynchro()
    {
        return $this->calendarSynchro;
    }
    /**
     * Add tag
     *
     * @param \AppBundle\Entity\Core\Tagg $tag
     *
     * @return Access
     */
    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;
    }
    /**
     * Sets educationNotationConfig.
     *
     * @param $educationNotationConfig
     *
     * @return $this
     */
    public function setEducationNotationConfig($educationNotationConfig)
    {
        $this->educationNotationConfig = $educationNotationConfig;

        return $this;
    }
    /**
     * Gets educationNotationCongig.
     *
     * @return EducationNotationConfig
     */
    public function getEducationNotationConfig()
    {
        return $this->educationNotationConfig;
    }
    /**
     * Set informationRetainedAndUsedDate
     *
     * @param \DateTime $informationRetainedAndUsedDate
     *
     * @return Access
     */
    public function setInformationRetainedAndUsedDate($informationRetainedAndUsedDate)
    {
        $this->informationRetainedAndUsedDate = $informationRetainedAndUsedDate;

        return $this;
    }
    /**
     * Get informationRetainedAndUsedDate
     *
     * @return \DateTime
     */
    public function getInformationRetainedAndUsedDate()
    {
        return $this->informationRetainedAndUsedDate;
    }
    /**
     * Set cguReadAndAcceptedDate
     *
     * @param \DateTime $cguReadAndAcceptedDate
     *
     * @return Access
     */
    public function setCguReadAndAcceptedDate($cguReadAndAcceptedDate)
    {
        $this->cguReadAndAcceptedDate = $cguReadAndAcceptedDate;

        return $this;
    }
    /**
     * Get cguReadAndAcceptedDate
     *
     * @return \DateTime
     */
    public function getCguReadAndAcceptedDate()
    {
        return $this->cguReadAndAcceptedDate;
    }
    /**
     * Get getCoursesNextYear
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getCoursesNextYear()
    {
        $datetimeNow = new \Datetime('now');
        $nextYear = $datetimeNow->format('Y');

        $courses = [];
        /** @var Course $course */
        foreach ($this->getCourses() as $course){
            if(!$course->getIsCanceled() && count($course->getEventRecur()) > 0 && $course->getStartYear() == $nextYear)
                $courses[] = $course;
        }

        return new ArrayCollection($courses);
    }
    /**
     * Sets publicationDirector.
     *
     * @param Parameters $publicationDirector
     *
     * @return $this
     */
    public function setPublicationDirector(Parameters $publicationDirector=null)
    {
        $this->publicationDirector = $publicationDirector;

        return $this;
    }
    /**
     * Add accessWish
     *
     * @param \AppBundle\Entity\AccessWish\AccessWish $accessWish
     *
     * @return Access
     */
    public function addAccessWish(\AppBundle\Entity\AccessWish\AccessWish $accessWish)
    {
        $accessWish->setAccessOriginal($this);
        $this->accessWishes[] = $accessWish;

        return $this;
    }
    /**
     * Remove accessWish
     *
     * @param \AppBundle\Entity\AccessWish\AccessWish $accessWish
     */
    public function removeAccessWish(\AppBundle\Entity\AccessWish\AccessWish $accessWish)
    {
        $this->accessWishes->removeElement($accessWish);
    }
    /**
     * Get accessWishes
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getAccessWishes()
    {
        return $this->accessWishes;
    }
}
