<?php
declare (strict_types=1);

namespace App\Entity\Organization;

use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Post;
use ApiPlatform\Metadata\Put;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\ApiResource;
use App\Entity\Access\Access;
use App\Entity\Billing\BillingSetting;
use App\Entity\Booking\Attendance;
use App\Entity\Booking\Course;
use App\Entity\Booking\EducationalProject;
use App\Entity\Booking\Event;
use App\Entity\Booking\Examen;
use App\Entity\Booking\OrganizationHoliday;
use App\Entity\Core\BankAccount;
use App\Entity\Core\ContactPoint;
use App\Entity\Core\File;
use App\Entity\Core\Notification;
use App\Entity\Core\Tagg;
use App\Entity\Donor\Donor;
use App\Entity\Education\CriteriaNotation;
use App\Entity\Education\Cycle;
use App\Entity\Education\EducationCategory;
use App\Entity\Education\EducationNotationConfig;
use App\Entity\Education\EducationTiming;
use App\Entity\Education\PeriodNotation;
use App\Entity\Message\Email;
use App\Entity\Message\Mail;
use App\Entity\Message\Sms;
use App\Entity\Network\NetworkOrganization;
use App\Entity\Person\Commission;
use App\Entity\Place\Place;
use App\Entity\Product\Equipment;
use App\Entity\Product\Intangible;
use App\Repository\Organization\OrganizationRepository;
use App\State\Processor\Organization\OrganizationProcessor;

//use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use JetBrains\PhpStorm\Pure;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Structure, organisation
 */
#[ApiResource(
    operations: [
        new Get(
            security: '(is_granted("ROLE_ORGANIZATION_VIEW") or is_granted("ROLE_ORGANIZATION")) and object.getId() == user.getOrganization().getId()'
        ),
        new Put(
            security: 'is_granted("ROLE_ORGANIZATION") and object.getId() == user.getOrganization().getId()'
        ),
        new Post(),
        new GetCollection()
    ],
    processor: OrganizationProcessor::class
)]
//#[Auditable]
#[ORM\Entity(repositoryClass: OrganizationRepository::class)]
class Organization
{
    #[ORM\Id]
    #[ORM\Column]
    #[ORM\GeneratedValue]
    private ?int $id = null;

    #[ORM\Column(length: 128, nullable: false)]
    public string $name;

    #[ORM\Column(length: 128)]
    private string $identifier;

    #[ORM\Column(length: 255, nullable: true)]
    #[Assert\Choice(callback: ['\\App\\Enum\\Organization\\LegalEnum', 'toArray'], message: 'invalid-legal-status')]
    private ?string $legalStatus = null;

    #[ORM\Column(length: 255, nullable: true)]
    #[Assert\Choice(callback: ['\\App\\Enum\\Organization\\PrincipalTypeEnum', 'toArray'], message: 'invalid-principal-type')]
    private ?string $principalType = null;

    #[ORM\OneToOne(mappedBy: 'organization', cascade: ['persist', 'remove'])]
    private Settings $settings;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Access::class, orphanRemoval: true)]
    private Collection $accesses;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: NetworkOrganization::class, orphanRemoval: true)]
    private Collection $networkOrganizations;

    #[ORM\OneToMany(mappedBy: 'parent', targetEntity: NetworkOrganization::class, orphanRemoval: true)]
    private Collection $networkOrganizationChildren;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: EducationNotationConfig::class, orphanRemoval: true)]
    private Collection $educationNotationConfigs;

    #[ORM\OneToOne(inversedBy: 'organization', targetEntity: Parameters::class)]
    #[ORM\JoinColumn(nullable: false)]
    private Parameters $parameters;

    #[ORM\OneToOne(mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
    private BillingSetting $billingSetting;

    #[ORM\Column(type: 'text', nullable: true)]
    private ?string $description = null;

    #[ORM\Column(type: 'date', nullable: true)]
    private ?\DateTimeInterface $creationDate = null;

    #[ORM\Column(type: 'date', nullable: true)]
    private ?\DateTimeInterface $declarationDate = null;

    #[ORM\Column(length: 14, nullable: true)]
    private ?string $siretNumber = null;

    #[ORM\Column(length: 10, nullable: true)]
    private ?string $waldecNumber = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $volumeAndFolioNumber = null;

    #[ORM\Column(length: 5, nullable: true)]
    private ?string $apeNumber = null;

    #[ORM\Column(length: 50, nullable: true)]
    private ?string $tvaNumber = null;

    #[ORM\Column(length: 40, nullable: true)]
    private ?string $otherType = null;

    #[ORM\Column(length: 80, nullable: true)]
    private ?string $acronym = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $facebook = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $twitter = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $youtube = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $instagram = null;

    #[ORM\Column(length: 35, nullable: true)]
    private ?string $collectiveAgreement = null;

    #[ORM\Column(length: 255, nullable: true)]
    #[Assert\Choice(callback: ['\\App\\Enum\\Organization\\OpcaEnum', 'toArray'], message: 'invalid-opca')]
    private ?string $opca = null;

    #[ORM\Column(length: 35, nullable: true)]
    private ?string $icomNumber = null;

    #[ORM\Column(length: 35, nullable: true)]
    private ?string $urssafNumber = null;

    #[ORM\Column(length: 20, nullable: true)]
    private ?string $youngApproval = null;

    #[ORM\Column(length: 20, nullable: true)]
    private ?string $trainingApproval = null;

    #[ORM\Column(length: 50, nullable: true)]
    private ?string $otherApproval = null;

    #[ORM\Column(length: 35, nullable: true)]
    private ?string $prefectureName = null;

    #[ORM\Column(length: 20, nullable: true)]
    private ?string $prefectureNumber = null;

    #[ORM\Column(length: 255, nullable: true)]
    #[Assert\Choice(callback: ['\\App\\Enum\\Organization\\CategoryEnum', 'toArray'], message: 'invalid-category')]
    private ?string $category = null;

    #[ORM\Column(length: 255, nullable: true)]
    #[Assert\Choice(callback: ['\\App\\Enum\\Organization\\SchoolCategoryEnum', 'toArray'], message: 'invalid-school-category')]
    private ?string $schoolCategory = null;

    #[ORM\Column(length: 255, nullable: true)]
    #[Assert\Choice(callback: ['\\App\\Enum\\Organization\\TypeEstablishmentEnum', 'toArray'], message: 'invalid-type-establishment')]
    private ?string $typeEstablishment = null;

    #[ORM\Column(length: 255, nullable: true)]
    #[Assert\Choice(callback: ['\\App\\Enum\\Organization\\TypeEstablishmentDetailEnum', 'toArray'], message: 'invalid-type-establishment-detail')]
    private ?string $typeEstablishmentDetail = null;

    #[ORM\Column(nullable: true)]
    private ?float $budget = null;

    #[ORM\Column(nullable: true)]
    private ?bool $isPedagogicIsPrincipalActivity = null;

    #[ORM\Column(nullable: true)]
    private ?float $pedagogicBudget = null;

    #[ORM\Column(nullable: true)]
    private ?bool $isPerformanceContractor = null;

    #[ORM\Column(length: 20, nullable: true)]
    private ?string $ffecApproval = null;

    #[ORM\Column]
    private bool $portailVisibility = true;

    #[ORM\Column(nullable: true)]
    private ?int $cmsId = null;

    #[ORM\ManyToOne(inversedBy: 'organizationLogos')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    private ?File $logo = null;

    #[ORM\ManyToOne(inversedBy: 'organizationImages')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    private ?File $image = null;

    #[ORM\ManyToMany(targetEntity: TypeOfPractice::class, mappedBy: 'organizations')]
    private Collection $typeOfPractices;

    #[ORM\Column(nullable: true)]
    private ?string $otherPractice = null;

    #[ORM\ManyToMany(targetEntity: ContactPoint::class, mappedBy: 'organization')]
    private Collection $contactPoints;

    #[ORM\ManyToMany(targetEntity: BankAccount::class, inversedBy: 'organization')]
    #[ORM\JoinColumn(name: 'organization_id', referencedColumnName: 'id', unique: true)]
    #[ORM\InverseJoinColumn(name: 'bankAccount_id', referencedColumnName: 'id')]
    private Collection $bankAccounts;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationAddressPostal::class, orphanRemoval: true)]
    private Collection $organizationAddressPostals;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationLicence::class, orphanRemoval: true)]
    private Collection $organizationLicences;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationArticle::class, orphanRemoval: true)]
    private Collection $organizationArticles;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Cycle::class, orphanRemoval: true)]
    private Collection $cycles;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: EducationTiming::class, orphanRemoval: true)]
    private Collection $educationTimings;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Subdomain::class)]
    private Collection $subdomains;

    #[ORM\ManyToOne(inversedBy: 'organizationContacts')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    private ?Access $contactPerson;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationHoliday::class, cascade: ['persist'], orphanRemoval: true)]
    private Collection $holidays;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Course::class, orphanRemoval: true)]
    private Collection $courses;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: EducationalProject::class, orphanRemoval: true)]
    private Collection $educationalProjects;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Event::class, orphanRemoval: true)]
    private Collection $events;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Examen::class, orphanRemoval: true)]
    private Collection $examens;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: CriteriaNotation::class, cascade: ['persist'], orphanRemoval: true)]
    private Collection $critereNotations;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: EducationCategory::class, orphanRemoval: true)]
    private Collection $educationCategories;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: PeriodNotation::class, orphanRemoval: true)]
    private Collection $periodNotations;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: File::class, orphanRemoval: true)]
    private Collection $files;

    #[ORM\OneToMany(mappedBy: 'recipientOrganization', targetEntity: Notification::class, orphanRemoval: true)]
    private Collection $notifications;

    #[ORM\OneToMany(mappedBy: 'author', targetEntity: Email::class)]
    private Collection $emails;

    #[ORM\OneToMany(mappedBy: 'author', targetEntity: Mail::class)]
    private Collection $mails;

    #[ORM\OneToMany(mappedBy: 'author', targetEntity: Sms::class)]
    private Collection $sms;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Activity::class, cascade: ['persist'], orphanRemoval: true)]
    private Collection $activities;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Jury::class, orphanRemoval: true)]
    private Collection $juries;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Commission::class, orphanRemoval: true)]
    private Collection $commissions;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Place::class, orphanRemoval: true)]
    private Collection $places;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Attendance::class, orphanRemoval: true)]
    private Collection $attendances;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Equipment::class, orphanRemoval: true)]
    private Collection $equipments;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Intangible::class, orphanRemoval: true)]
    private Collection $intangibles;

    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Donor::class, orphanRemoval: true)]
    private Collection $donors;

    #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'organizations', cascade: ['persist'])]
    #[ORM\JoinTable(name: 'tag_organization')]
    #[ORM\JoinColumn(name: 'organization_id', referencedColumnName: 'id')]
    #[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id')]
    private Collection $tags;

    #[Pure]
    public function __construct()
    {
        $this->accesses = new ArrayCollection();
        $this->networkOrganizations = new ArrayCollection();
        $this->networkOrganizationChildren = new ArrayCollection();
        $this->typeOfPractices = new ArrayCollection();
        $this->contactPoints = new ArrayCollection();
        $this->bankAccounts = new ArrayCollection();
        $this->organizationAddressPostals = new ArrayCollection();
        $this->organizationLicences = new ArrayCollection();
        $this->organizationArticles = new ArrayCollection();
        $this->cycles = new ArrayCollection();
        $this->educationTimings = new ArrayCollection();
        $this->educationNotationConfigs = new ArrayCollection();
        $this->subdomains = new ArrayCollection();
        $this->holidays = new ArrayCollection();
        $this->courses = new ArrayCollection();
        $this->educationalProjects = new ArrayCollection();
        $this->events = new ArrayCollection();
        $this->examens = new ArrayCollection();
        $this->critereNotations = new ArrayCollection();
        $this->educationCategories = new ArrayCollection();
        $this->periodNotations = new ArrayCollection();
        $this->files = new ArrayCollection();
        $this->notifications = new ArrayCollection();
        $this->emails = new ArrayCollection();
        $this->mails = new ArrayCollection();
        $this->sms = new ArrayCollection();
        $this->activities = new ArrayCollection();
        $this->juries = new ArrayCollection();
        $this->commissions = new ArrayCollection();
        $this->places = new ArrayCollection();
        $this->attendances = new ArrayCollection();
        $this->equipments = new ArrayCollection();
        $this->intangibles = new ArrayCollection();
        $this->donors = new ArrayCollection();
        $this->tags = new ArrayCollection();
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getName(): string
    {
        return $this->name;
    }

    public function setName(string $name): self
    {
        $this->name = $name;
        return $this;
    }

    public function getIdentifier(): string
    {
        return $this->identifier;
    }

    public function setIdentifier(string $identifier): self
    {
        $this->identifier = $identifier;
        return $this;
    }

    public function getLegalStatus(): ?string
    {
        return $this->legalStatus;
    }

    public function setLegalStatus(?string $legalStatus): self
    {
        $this->legalStatus = $legalStatus;
        return $this;
    }

    public function getPrincipalType(): ?string
    {
        return $this->principalType;
    }

    public function setPrincipalType(?string $principalType): self
    {
        $this->principalType = $principalType;
        return $this;
    }

    public function getSettings(): Settings
    {
        return $this->settings;
    }

    public function setSettings(Settings $settings): self
    {
        // set the owning side of the relation if necessary
        if ($settings->getOrganization() !== $this) {
            $settings->setOrganization($this);
        }
        $this->settings = $settings;
        return $this;
    }

    public function getAccesses(): Collection
    {
        return $this->accesses;
    }

    public function getNetworkOrganizations(): Collection
    {
        return $this->networkOrganizations;
    }

    public function addNetworkOrganization(NetworkOrganization $networkOrganization): self
    {
        if (!$this->networkOrganizations->contains($networkOrganization)) {
            $this->networkOrganizations[] = $networkOrganization;
            $networkOrganization->setOrganization($this);
        }
        return $this;
    }

    public function removeNetworkOrganization(NetworkOrganization $networkOrganization): self
    {
        if ($this->networkOrganizations->removeElement($networkOrganization)) {
            // set the owning side to null (unless already changed)
            if ($networkOrganization->getOrganization() === $this) {
                $networkOrganization->setOrganization(null);
            }
        }
        return $this;
    }

    public function getNetworkOrganizationChildren(): Collection
    {
        return $this->networkOrganizationChildren;
    }

    public function addNetworkOrganizationChild(NetworkOrganization $networkOrganizationChild): self
    {
        if (!$this->networkOrganizationChildren->contains($networkOrganizationChild)) {
            $this->networkOrganizationChildren[] = $networkOrganizationChild;
            $networkOrganizationChild->setParent($this);
        }
        return $this;
    }

    public function removeNetworkOrganizationChild(NetworkOrganization $networkOrganizationChild): self
    {
        if ($this->networkOrganizationChildren->removeElement($networkOrganizationChild)) {
            // set the owning side to null (unless already changed)
            if ($networkOrganizationChild->getParent() === $this) {
                $networkOrganizationChild->setParent(null);
            }
        }
        return $this;
    }

    public function getParameters(): Parameters
    {
        return $this->parameters;
    }

    public function setParameters(Parameters $parameters): self
    {
        $this->parameters = $parameters;
        return $this;
    }

    /**
     * @return File
     */
    public function getLogo(): ?File
    {
        return $this->logo;
    }

    /**
     * @param File $logo
     */
    public function setLogo(?File $logo): void
    {
        $this->logo = $logo;
    }

    public function getBillingSetting(): BillingSetting
    {
        return $this->billingSetting;
    }

    public function setBillingSetting(BillingSetting $billingSetting): self
    {
        $this->billingSetting = $billingSetting;
        return $this;
    }

    public function getDescription(): ?string
    {
        return $this->description;
    }

    public function setDescription(?string $description): self
    {
        $this->description = $description;
        return $this;
    }

    public function getCreationDate(): ?\DateTimeInterface
    {
        return $this->creationDate;
    }

    public function setCreationDate(?\DateTimeInterface $creationDate): self
    {
        $this->creationDate = $creationDate;
        return $this;
    }

    public function getDeclarationDate(): ?\DateTimeInterface
    {
        return $this->declarationDate;
    }

    public function setDeclarationDate(?\DateTimeInterface $declarationDate): self
    {
        $this->declarationDate = $declarationDate;
        return $this;
    }

    public function getSiretNumber(): ?string
    {
        return $this->siretNumber;
    }

    public function setSiretNumber(?string $siretNumber): self
    {
        $this->siretNumber = $siretNumber;
        return $this;
    }

    public function getWaldecNumber(): ?string
    {
        return $this->waldecNumber;
    }

    public function setWaldecNumber(?string $waldecNumber): self
    {
        $this->waldecNumber = $waldecNumber;
        return $this;
    }

    public function getVolumeAndFolioNumber(): ?string
    {
        return $this->volumeAndFolioNumber;
    }

    public function setVolumeAndFolioNumber(?string $volumeAndFolioNumber): self
    {
        $this->volumeAndFolioNumber = $volumeAndFolioNumber;
        return $this;
    }

    public function getApeNumber(): ?string
    {
        return $this->apeNumber;
    }

    public function setApeNumber(?string $apeNumber): self
    {
        $this->apeNumber = $apeNumber;
        return $this;
    }

    public function getTvaNumber(): ?string
    {
        return $this->tvaNumber;
    }

    public function setTvaNumber(?string $tvaNumber): self
    {
        $this->tvaNumber = $tvaNumber;
        return $this;
    }

    public function getOtherType(): ?string
    {
        return $this->otherType;
    }

    public function setOtherType(?string $otherType): self
    {
        $this->otherType = $otherType;
        return $this;
    }

    public function getAcronym(): ?string
    {
        return $this->acronym;
    }

    public function setAcronym(?string $acronym): self
    {
        $this->acronym = $acronym;
        return $this;
    }

    public function getFacebook(): ?string
    {
        return $this->facebook;
    }

    public function setFacebook(?string $facebook): self
    {
        $this->facebook = $facebook;
        return $this;
    }

    public function getTwitter(): ?string
    {
        return $this->twitter;
    }

    public function setTwitter(?string $twitter): self
    {
        $this->twitter = $twitter;
        return $this;
    }

    public function getYoutube(): ?string
    {
        return $this->youtube;
    }

    public function setYoutube(?string $youtube): self
    {
        $this->youtube = $youtube;
        return $this;
    }

    public function getInstagram(): ?string
    {
        return $this->instagram;
    }

    public function setInstagram(?string $instagram): self
    {
        $this->instagram = $instagram;
        return $this;
    }

    public function getCollectiveAgreement(): ?string
    {
        return $this->collectiveAgreement;
    }

    public function setCollectiveAgreement(?string $collectiveAgreement): self
    {
        $this->collectiveAgreement = $collectiveAgreement;
        return $this;
    }

    public function getOpca(): ?string
    {
        return $this->opca;
    }

    public function setOpca(?string $opca): self
    {
        $this->opca = $opca;
        return $this;
    }

    public function getIcomNumber(): ?string
    {
        return $this->icomNumber;
    }

    public function setIcomNumber(?string $icomNumber): self
    {
        $this->icomNumber = $icomNumber;
        return $this;
    }

    public function getUrssafNumber(): ?string
    {
        return $this->urssafNumber;
    }

    public function setUrssafNumber(?string $urssafNumber): self
    {
        $this->urssafNumber = $urssafNumber;
        return $this;
    }

    public function getYoungApproval(): ?string
    {
        return $this->youngApproval;
    }

    public function setYoungApproval(?string $youngApproval): self
    {
        $this->youngApproval = $youngApproval;
        return $this;
    }

    public function getTrainingApproval(): ?string
    {
        return $this->trainingApproval;
    }

    public function setTrainingApproval(?string $trainingApproval): self
    {
        $this->trainingApproval = $trainingApproval;
        return $this;
    }

    public function getOtherApproval(): ?string
    {
        return $this->otherApproval;
    }

    public function setOtherApproval(?string $otherApproval): self
    {
        $this->otherApproval = $otherApproval;
        return $this;
    }

    public function getPrefectureName(): ?string
    {
        return $this->prefectureName;
    }

    public function setPrefectureName(?string $prefectureName): self
    {
        $this->prefectureName = $prefectureName;
        return $this;
    }

    public function getPrefectureNumber(): ?string
    {
        return $this->prefectureNumber;
    }

    public function setPrefectureNumber(?string $prefectureNumber): self
    {
        $this->prefectureNumber = $prefectureNumber;
        return $this;
    }

    public function getCategory(): ?string
    {
        return $this->category;
    }

    public function setCategory(?string $category): self
    {
        $this->category = $category;
        return $this;
    }

    public function getSchoolCategory(): ?string
    {
        return $this->schoolCategory;
    }

    public function setSchoolCategory(?string $schoolCategory): self
    {
        $this->schoolCategory = $schoolCategory;
        return $this;
    }

    public function getTypeEstablishment(): ?string
    {
        return $this->typeEstablishment;
    }

    public function setTypeEstablishment(?string $typeEstablishment): self
    {
        $this->typeEstablishment = $typeEstablishment;
        return $this;
    }

    public function getTypeEstablishmentDetail(): ?string
    {
        return $this->typeEstablishmentDetail;
    }

    public function setTypeEstablishmentDetail(?string $typeEstablishmentDetail): self
    {
        $this->typeEstablishmentDetail = $typeEstablishmentDetail;
        return $this;
    }

    public function getBudget(): ?float
    {
        return $this->budget;
    }

    public function setBudget(?float $budget): self
    {
        $this->budget = $budget;
        return $this;
    }

    public function getIsPedagogicIsPrincipalActivity(): ?bool
    {
        return $this->isPedagogicIsPrincipalActivity;
    }

    public function setIsPedagogicIsPrincipalActivity(?bool $isPedagogicIsPrincipalActivity): self
    {
        $this->isPedagogicIsPrincipalActivity = $isPedagogicIsPrincipalActivity;
        return $this;
    }

    public function getPedagogicBudget(): ?float
    {
        return $this->pedagogicBudget;
    }

    public function setPedagogicBudget(?float $pedagogicBudget): self
    {
        $this->pedagogicBudget = $pedagogicBudget;
        return $this;
    }

    public function getIsPerformanceContractor(): ?bool
    {
        return $this->isPerformanceContractor;
    }

    public function setIsPerformanceContractor(?bool $isPerformanceContractor): self
    {
        $this->isPerformanceContractor = $isPerformanceContractor;
        return $this;
    }

    public function getFfecApproval(): ?string
    {
        return $this->ffecApproval;
    }

    public function setFfecApproval(?string $ffecApproval): self
    {
        $this->ffecApproval = $ffecApproval;
        return $this;
    }

    public function getPortailVisibility(): bool
    {
        return $this->portailVisibility;
    }

    public function setPortailVisibility(bool $portailVisibility): self
    {
        $this->portailVisibility = $portailVisibility;
        return $this;
    }

    public function getCmsId(): ?int
    {
        return $this->cmsId;
    }

    public function setCmsId(?int $cmsId): self
    {
        $this->cmsId = $cmsId;
        return $this;
    }

    public function setImage(?File $image): self
    {
        $this->image = $image;
        return $this;
    }

    public function getImage(): ?File
    {
        return $this->image;
    }

    public function getTypeOfPractices(): Collection
    {
        return $this->typeOfPractices;
    }

    public function addTypeOfPractice(TypeOfPractice $typeOfPractice): self
    {
        if (!$this->typeOfPractices->contains($typeOfPractice)) {
            $this->typeOfPractices[] = $typeOfPractice;
            $typeOfPractice->addOrganization($this);
        }
        return $this;
    }

    public function removeTypeOfPractice(TypeOfPractice $typeOfPractice): self
    {
        if ($this->typeOfPractices->removeElement($typeOfPractice)) {
            $typeOfPractice->removeOrganization($this);
        }
        return $this;
    }

    public function getOtherPractice(): ?string
    {
        return $this->otherPractice;
    }

    public function setOtherPractice(?string $otherPractice): self
    {
        $this->otherPractice = $otherPractice;
        return $this;
    }

    public function getContactPoints(): Collection
    {
        return $this->contactPoints;
    }

    public function addContactPoint(ContactPoint $contactPoint): self
    {
        if (!$this->contactPoints->contains($contactPoint)) {
            $this->contactPoints[] = $contactPoint;
            $contactPoint->addOrganization($this);
        }
        return $this;
    }

    public function removeContactPoint(ContactPoint $contactPoint): self
    {
        if ($this->contactPoints->removeElement($contactPoint)) {
            $contactPoint->removeOrganization($this);
        }
        return $this;
    }

    public function getBankAccounts(): Collection
    {
        return $this->bankAccounts;
    }

    public function addBankAccount(BankAccount $bankAccount): self
    {
        if (!$this->bankAccounts->contains($bankAccount)) {
            $this->bankAccounts[] = $bankAccount;
            $bankAccount->addOrganization($this);
        }
        return $this;
    }

    public function removeBankAccount(BankAccount $bankAccount): self
    {
        if ($this->bankAccounts->removeElement($bankAccount)) {
            $bankAccount->removeOrganization($this);
        }
        return $this;
    }

    public function getOrganizationAddressPostals(): Collection
    {
        return $this->organizationAddressPostals;
    }

    public function addOrganizationAddressPostal(OrganizationAddressPostal $organizationAddressPostal): self
    {
        if (!$this->organizationAddressPostals->contains($organizationAddressPostal)) {
            $this->organizationAddressPostals[] = $organizationAddressPostal;
            $organizationAddressPostal->setOrganization($this);
        }
        return $this;
    }

    public function removeOrganizationAddressPostal(OrganizationAddressPostal $organizationAddressPostal): self
    {
        if ($this->organizationAddressPostals->removeElement($organizationAddressPostal)) {
            // set the owning side to null (unless already changed)
            if ($organizationAddressPostal->getOrganization() === $this) {
                $organizationAddressPostal->setOrganization(null);
            }
        }
        return $this;
    }

    public function getOrganizationLicences(): Collection
    {
        return $this->organizationLicences;
    }

    public function addOrganizationLicence(OrganizationLicence $organizationLicence): self
    {
        if (!$this->organizationLicences->contains($organizationLicence)) {
            $this->organizationLicences[] = $organizationLicence;
            $organizationLicence->setOrganization($this);
        }
        return $this;
    }

    public function removeOrganizationLicence(OrganizationLicence $organizationLicence): self
    {
        if ($this->organizationLicences->removeElement($organizationLicence)) {
            // set the owning side to null (unless already changed)
            if ($organizationLicence->getOrganization() === $this) {
                $organizationLicence->setOrganization(null);
            }
        }
        return $this;
    }

    public function getOrganizationArticles(): Collection
    {
        return $this->organizationArticles;
    }

    public function addOrganizationArticle(OrganizationArticle $organizationArticle): self
    {
        if (!$this->organizationArticles->contains($organizationArticle)) {
            $this->organizationArticles[] = $organizationArticle;
            $organizationArticle->setOrganization($this);
        }
        return $this;
    }

    public function removeOrganizationArticle(OrganizationArticle $organizationArticle): self
    {
        if ($this->organizationArticles->removeElement($organizationArticle)) {
            // set the owning side to null (unless already changed)
            if ($organizationArticle->getOrganization() === $this) {
                $organizationArticle->setOrganization(null);
            }
        }
        return $this;
    }

    public function addCycle(Cycle $cycle): self
    {
        if (!$this->cycles->contains($cycle)) {
            $this->cycles[] = $cycle;
            $cycle->setOrganization($this);
        }
        return $this;
    }

    public function removeCycle(Cycle $cycle): self
    {
        if ($this->cycles->removeElement($cycle)) {
            // set the owning side to null (unless already changed)
            if ($cycle->getOrganization() === $this) {
                $cycle->setOrganization(null);
            }
        }
        return $this;
    }

    public function getCycles(): Collection
    {
        return $this->cycles;
    }

    public function addEducationNotationConfig(EducationNotationConfig $educationNotationConfig): self
    {
        if (!$this->educationNotationConfigs->contains($educationNotationConfig)) {
            $this->educationNotationConfigs[] = $educationNotationConfig;
            $educationNotationConfig->setOrganization($this);
        }
        return $this;
    }

    public function removeEducationNotationConfig(EducationNotationConfig $educationNotationConfig): self
    {
        if ($this->educationNotationConfigs->removeElement($educationNotationConfig)) {
            // set the owning side to null (unless already changed)
            if ($educationNotationConfig->getOrganization() === $this) {
                $educationNotationConfig->setOrganization(null);
            }
        }
        return $this;
    }

    public function getEducationNotationConfigs(): Collection
    {
        return $this->educationNotationConfigs;
    }

    public function addEducationTiming(EducationTiming $educationTiming): self
    {
        if (!$this->educationTimings->contains($educationTiming)) {
            $this->educationTimings[] = $educationTiming;
            $educationTiming->setOrganization($this);
        }
        return $this;
    }

    public function removeEducationTiming(EducationTiming $educationTiming): self
    {
        if ($this->educationTimings->removeElement($educationTiming)) {
            // set the owning side to null (unless already changed)
            if ($educationTiming->getOrganization() === $this) {
                $educationTiming->setOrganization(null);
            }
        }
        return $this;
    }

    public function getEducationTimings(): Collection
    {
        return $this->educationTimings;
    }

    public function getSubdomains(): Collection
    {
        return $this->subdomains;
    }

    public function addAccess(Access $access): self
    {
        if (!$this->accesses->contains($access)) {
            $this->accesses[] = $access;
            $access->setOrganization($this);
        }
        return $this;
    }

    public function removeAccess(Access $access): self
    {
        if ($this->accesses->removeElement($access)) {
            // set the owning side to null (unless already changed)
            if ($access->getOrganization() === $this) {
                $access->setOrganization(null);
            }
        }
        return $this;
    }

    public function getContactPerson(): ?Access
    {
        return $this->contactPerson;
    }

    public function setContactPerson(?Access $contactPerson): self
    {
        $this->contactPerson = $contactPerson;
        return $this;
    }

    /**
     * @return Collection<int, OrganizationHoliday>
     */
    public function getHolidays(): Collection
    {
        return $this->holidays;
    }

    public function addHoliday(OrganizationHoliday $holiday): self
    {
        if (!$this->holidays->contains($holiday)) {
            $this->holidays[] = $holiday;
            $holiday->setOrganization($this);
        }
        return $this;
    }

    public function removeHoliday(OrganizationHoliday $holiday): self
    {
        if ($this->holidays->removeElement($holiday)) {
            // set the owning side to null (unless already changed)
            if ($holiday->getOrganization() === $this) {
                $holiday->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Course>
     */
    public function getCourses(): Collection
    {
        return $this->courses;
    }

    public function addCourse(Course $course): self
    {
        if (!$this->courses->contains($course)) {
            $this->courses[] = $course;
            $course->setOrganization($this);
        }
        return $this;
    }

    public function removeCourse(Course $course): self
    {
        if ($this->courses->removeElement($course)) {
            // set the owning side to null (unless already changed)
            if ($course->getOrganization() === $this) {
                $course->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, EducationalProject>
     */
    public function getEducationalProjects(): Collection
    {
        return $this->educationalProjects;
    }

    public function addEducationalProject(EducationalProject $educationalProject): self
    {
        if (!$this->educationalProjects->contains($educationalProject)) {
            $this->educationalProjects[] = $educationalProject;
            $educationalProject->setOrganization($this);
        }
        return $this;
    }

    public function removeEducationalProject(EducationalProject $educationalProject): self
    {
        if ($this->educationalProjects->removeElement($educationalProject)) {
            // set the owning side to null (unless already changed)
            if ($educationalProject->getOrganization() === $this) {
                $educationalProject->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Event>
     */
    public function getEvents(): Collection
    {
        return $this->events;
    }

    public function addEvent(Event $event): self
    {
        if (!$this->events->contains($event)) {
            $this->events[] = $event;
            $event->setOrganization($this);
        }
        return $this;
    }

    public function removeEvent(Event $event): self
    {
        if ($this->events->removeElement($event)) {
            // set the owning side to null (unless already changed)
            if ($event->getOrganization() === $this) {
                $event->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Examen>
     */
    public function getExamens(): Collection
    {
        return $this->examens;
    }

    public function addExamen(Examen $examen): self
    {
        if (!$this->examens->contains($examen)) {
            $this->examens[] = $examen;
            $examen->setOrganization($this);
        }
        return $this;
    }

    public function removeExamen(Examen $examen): self
    {
        if ($this->examens->removeElement($examen)) {
            // set the owning side to null (unless already changed)
            if ($examen->getOrganization() === $this) {
                $examen->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, CriteriaNotation>
     */
    public function getCritereNotations(): Collection
    {
        return $this->critereNotations;
    }

    public function addCritereNotation(CriteriaNotation $critereNotation): self
    {
        if (!$this->critereNotations->contains($critereNotation)) {
            $this->critereNotations[] = $critereNotation;
            $critereNotation->setOrganization($this);
        }
        return $this;
    }

    public function removeCritereNotation(CriteriaNotation $critereNotation): self
    {
        if ($this->critereNotations->removeElement($critereNotation)) {
            // set the owning side to null (unless already changed)
            if ($critereNotation->getOrganization() === $this) {
                $critereNotation->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, EducationCategory>
     */
    public function getEducationCategories(): Collection
    {
        return $this->educationCategories;
    }

    public function addEducationCategory(EducationCategory $educationCategory): self
    {
        if (!$this->educationCategories->contains($educationCategory)) {
            $this->educationCategories[] = $educationCategory;
            $educationCategory->setOrganization($this);
        }
        return $this;
    }

    public function removeEducationCategory(EducationCategory $educationCategory): self
    {
        if ($this->educationCategories->removeElement($educationCategory)) {
            // set the owning side to null (unless already changed)
            if ($educationCategory->getOrganization() === $this) {
                $educationCategory->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, PeriodNotation>
     */
    public function getPeriodNotations(): Collection
    {
        return $this->periodNotations;
    }

    public function addPeriodNotation(PeriodNotation $periodNotation): self
    {
        if (!$this->periodNotations->contains($periodNotation)) {
            $this->periodNotations[] = $periodNotation;
            $periodNotation->setOrganization($this);
        }
        return $this;
    }

    public function removePeriodNotation(PeriodNotation $periodNotation): self
    {
        if ($this->periodNotations->removeElement($periodNotation)) {
            // set the owning side to null (unless already changed)
            if ($periodNotation->getOrganization() === $this) {
                $periodNotation->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, File>
     */
    public function getFiles(): Collection
    {
        return $this->files;
    }

    public function addFile(File $file): self
    {
        if (!$this->files->contains($file)) {
            $this->files[] = $file;
            $file->setOrganization($this);
        }
        return $this;
    }

    public function removeFile(File $file): self
    {
        if ($this->files->removeElement($file)) {
            // set the owning side to null (unless already changed)
            if ($file->getOrganization() === $this) {
                $file->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Notification>
     */
    public function getNotifications(): Collection
    {
        return $this->notifications;
    }

    public function addNotification(Notification $notification): self
    {
        if (!$this->notifications->contains($notification)) {
            $this->notifications[] = $notification;
            $notification->setRecipientOrganization($this);
        }
        return $this;
    }

    public function removeNotification(Notification $notification): self
    {
        if ($this->notifications->removeElement($notification)) {
            // set the owning side to null (unless already changed)
            if ($notification->getRecipientOrganization() === $this) {
                $notification->setRecipientOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Email>
     */
    public function getEmails(): Collection
    {
        return $this->emails;
    }

    /**
     * @return Collection<int, Mail>
     */
    public function getMails(): Collection
    {
        return $this->mails;
    }

    /**
     * @return Collection<int, Sms>
     */
    public function getSms(): Collection
    {
        return $this->sms;
    }

    /**
     * @return Collection<int, Activity>
     */
    public function getActivities(): Collection
    {
        return $this->activities;
    }

    public function addActivity(Activity $activity): self
    {
        if (!$this->activities->contains($activity)) {
            $this->activities[] = $activity;
            $activity->setOrganization($this);
        }
        return $this;
    }

    public function removeActivity(Activity $activity): self
    {
        if ($this->activities->removeElement($activity)) {
            // set the owning side to null (unless already changed)
            if ($activity->getOrganization() === $this) {
                $activity->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Jury>
     */
    public function getJuries(): Collection
    {
        return $this->juries;
    }

    public function addJury(Jury $jury): self
    {
        if (!$this->juries->contains($jury)) {
            $this->juries[] = $jury;
            $jury->setOrganization($this);
        }
        return $this;
    }

    public function removeJury(Jury $jury): self
    {
        if ($this->juries->removeElement($jury)) {
            // set the owning side to null (unless already changed)
            if ($jury->getOrganization() === $this) {
                $jury->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Commission>
     */
    public function getCommissions(): Collection
    {
        return $this->commissions;
    }

    public function addCommission(Commission $commission): self
    {
        if (!$this->commissions->contains($commission)) {
            $this->commissions[] = $commission;
            $commission->setOrganization($this);
        }
        return $this;
    }

    public function removeCommission(Commission $commission): self
    {
        if ($this->commissions->removeElement($commission)) {
            // set the owning side to null (unless already changed)
            if ($commission->getOrganization() === $this) {
                $commission->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Place>
     */
    public function getPlaces(): Collection
    {
        return $this->places;
    }

    public function addPlace(Place $place): self
    {
        if (!$this->places->contains($place)) {
            $this->places[] = $place;
            $place->setOrganization($this);
        }
        return $this;
    }

    public function removePlace(Place $place): self
    {
        if ($this->places->removeElement($place)) {
            // set the owning side to null (unless already changed)
            if ($place->getOrganization() === $this) {
                $place->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Attendance>
     */
    public function getAttendances(): Collection
    {
        return $this->attendances;
    }

    public function addAttendance(Attendance $attendance): self
    {
        if (!$this->attendances->contains($attendance)) {
            $this->attendances[] = $attendance;
            $attendance->setOrganization($this);
        }
        return $this;
    }

    public function removeAttendance(Attendance $attendance): self
    {
        if ($this->attendances->removeElement($attendance)) {
            // set the owning side to null (unless already changed)
            if ($attendance->getOrganization() === $this) {
                $attendance->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Equipment>
     */
    public function getEquipments(): Collection
    {
        return $this->equipments;
    }

    public function addEquipment(Equipment $equipment): self
    {
        if (!$this->equipments->contains($equipment)) {
            $this->equipments[] = $equipment;
            $equipment->setOrganization($this);
        }
        return $this;
    }

    public function removeEquipment(Equipment $equipment): self
    {
        if ($this->equipments->removeElement($equipment)) {
            // set the owning side to null (unless already changed)
            if ($equipment->getOrganization() === $this) {
                $equipment->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Intangible>
     */
    public function getIntangibles(): Collection
    {
        return $this->intangibles;
    }

    public function addIntangible(Intangible $intangible): self
    {
        if (!$this->intangibles->contains($intangible)) {
            $this->intangibles[] = $intangible;
            $intangible->setOrganization($this);
        }
        return $this;
    }

    public function removeIntangible(Intangible $intangible): self
    {
        if ($this->intangibles->removeElement($intangible)) {
            // set the owning side to null (unless already changed)
            if ($intangible->getOrganization() === $this) {
                $intangible->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Donor>
     */
    public function getDonors(): Collection
    {
        return $this->donors;
    }

    public function addDonor(Donor $donor): self
    {
        if (!$this->donors->contains($donor)) {
            $this->donors[] = $donor;
            $donor->setOrganization($this);
        }
        return $this;
    }

    public function removeDonor(Donor $donor): self
    {
        if ($this->donors->removeElement($donor)) {
            // set the owning side to null (unless already changed)
            if ($donor->getOrganization() === $this) {
                $donor->setOrganization(null);
            }
        }
        return $this;
    }

    /**
     * @return Collection<int, Tagg>
     */
    public function getTags(): Collection
    {
        return $this->tags;
    }

    public function addTag(Tagg $tag): self
    {
        if (!$this->tags->contains($tag)) {
            $this->tags[] = $tag;
        }
        return $this;
    }

    public function removeTag(Tagg $tag): self
    {
        $this->tags->removeElement($tag);
        return $this;
    }
}
