[ 'security' => '(is_granted("ROLE_ORGANIZATION_VIEW") or is_granted("ROLE_ORGANIZATION")) and object.getId() == user.getOrganization().getId()' ], 'put' => [ 'security' => 'is_granted("ROLE_ORGANIZATION") and object.getId() == user.getOrganization()s.getId()' ] ] )] #[ORM\Entity(repositoryClass: OrganizationRepository::class)] class Organization { #[ORM\Id] #[ORM\Column] #[ORM\GeneratedValue] private ?int $id = null; #[ORM\Column(length: 128)] 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: NetworkOrganization::class, orphanRemoval: true)] private Collection $networkOrganizations; #[ORM\OneToMany(mappedBy: 'parent', targetEntity: NetworkOrganization::class, orphanRemoval: true)] private Collection $networkOrganizationChildren; #[ORM\OneToOne(cascade: ['persist', 'remove'])] #[ORM\JoinColumn(nullable: false)] private Parameters $parameters; #[ORM\Column(length: 255, 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: 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 $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; #[ORM\Column(nullable: true)] private ?int $cmsId = null; #[ORM\Column(nullable: true)] private ?string $otherPractice = null; #[ORM\ManyToMany(targetEntity: ContactPoint::class, mappedBy: 'organization')] #[ApiSubresource] private Collection $contactPoints; #[ORM\ManyToMany(targetEntity: BankAccount::class, mappedBy: 'organization')] #[ApiSubresource] private Collection $bankAccounts; #[ORM\OneToMany( mappedBy: 'organization', targetEntity: OrganizationAddressPostal::class, orphanRemoval: true)] #[ApiSubresource] private Collection $organizationAddressPostals; #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationLicence::class, orphanRemoval: true)] private Collection $organizationLicences; #[Pure] public function __construct() { $this->networkOrganizations = new ArrayCollection(); $this->networkOrganizationChildren = new ArrayCollection(); $this->contactPoints = new ArrayCollection(); $this->bankAccounts = new ArrayCollection(); $this->organizationAddressPostals = new ArrayCollection(); $this->organizationLicences = 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 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; } 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 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 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 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; } }