Organization.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Organization;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use ApiPlatform\Core\Annotation\ApiSubresource;
  6. use App\Entity\Billing\BillingSetting;
  7. use App\Entity\Core\BankAccount;
  8. use App\Entity\Core\ContactPoint;
  9. use App\Entity\Core\File;
  10. use App\Entity\Network\NetworkOrganization;
  11. use App\Repository\Organization\OrganizationRepository;
  12. use Doctrine\Common\Collections\ArrayCollection;
  13. use Doctrine\Common\Collections\Collection;
  14. use Doctrine\ORM\Mapping as ORM;
  15. use JetBrains\PhpStorm\Pure;
  16. use Symfony\Component\Validator\Constraints as Assert;
  17. /**
  18. * Structure, organisation
  19. */
  20. #[ApiResource(
  21. itemOperations: [
  22. 'get' => [
  23. 'security' => '(is_granted("ROLE_ORGANIZATION_VIEW") or is_granted("ROLE_ORGANIZATION")) and object.getId() == user.getOrganization().getId()'
  24. ],
  25. 'put' => [
  26. 'security' => 'is_granted("ROLE_ORGANIZATION") and object.getId() == user.getOrganization().getId()'
  27. ]
  28. ]
  29. )]
  30. #[ORM\Entity(repositoryClass: OrganizationRepository::class)]
  31. class Organization
  32. {
  33. #[ORM\Id]
  34. #[ORM\Column]
  35. #[ORM\GeneratedValue]
  36. private ?int $id = null;
  37. #[ORM\Column(length: 128, nullable: false)]
  38. public string $name;
  39. #[ORM\Column(length: 128)]
  40. private string $identifier;
  41. #[ORM\Column(length: 255, nullable: true)]
  42. #[Assert\Choice(callback: ['\App\Enum\Organization\LegalEnum', 'toArray'], message: 'invalid-legal-status')]
  43. private ?string $legalStatus = null;
  44. #[ORM\Column(length: 255, nullable: true)]
  45. #[Assert\Choice(callback: ['\App\Enum\Organization\PrincipalTypeEnum', 'toArray'], message: 'invalid-principal-type')]
  46. private ?string $principalType = null;
  47. #[ORM\OneToOne(mappedBy: 'organization', cascade: ['persist', 'remove'])]
  48. private Settings $settings;
  49. #[ORM\OneToMany(mappedBy: 'organization', targetEntity: NetworkOrganization::class, orphanRemoval: true)]
  50. #[ApiSubresource]
  51. private Collection $networkOrganizations;
  52. #[ORM\OneToMany(mappedBy: 'parent', targetEntity: NetworkOrganization::class, orphanRemoval: true)]
  53. private Collection $networkOrganizationChildren;
  54. #[ORM\OneToOne(cascade: ['persist', 'remove'])]
  55. #[ORM\JoinColumn(nullable: false)]
  56. private Parameters $parameters;
  57. #[ORM\OneToOne(mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
  58. private BillingSetting $billingSetting;
  59. #[ORM\Column(length: 255, nullable: true)]
  60. private ?string $description = null;
  61. #[ORM\Column(type: 'date', nullable: true)]
  62. private ?\DateTimeInterface $creationDate = null;
  63. #[ORM\Column(type: 'date', nullable: true)]
  64. private ?\DateTimeInterface $declarationDate = null;
  65. #[ORM\Column(length: 14, nullable: true)]
  66. private ?string $siretNumber = null;
  67. #[ORM\Column(length: 10, nullable: true)]
  68. private ?string $waldecNumber = null;
  69. #[ORM\Column(length: 5, nullable: true)]
  70. private ?string $apeNumber = null;
  71. #[ORM\Column(length: 50, nullable: true)]
  72. private ?string $tvaNumber = null;
  73. #[ORM\Column(length: 40, nullable: true)]
  74. private ?string $otherType = null;
  75. #[ORM\Column(length: 80, nullable: true)]
  76. private ?string $acronym = null;
  77. #[ORM\Column(length: 255, nullable: true)]
  78. private ?string $facebook = null;
  79. #[ORM\Column(length: 255, nullable: true)]
  80. private ?string $twitter = null;
  81. #[ORM\Column(length: 255, nullable: true)]
  82. private ?string $youtube = null;
  83. #[ORM\Column(length: 255, nullable: true)]
  84. private ?string $instagram = null;
  85. #[ORM\Column(length: 35, nullable: true)]
  86. private ?string $collectiveAgreement = null;
  87. #[ORM\Column(length: 255, nullable: true)]
  88. #[Assert\Choice(callback: ['\App\Enum\Organization\OpcaEnum', 'toArray'], message: 'invalid-opca')]
  89. private ?string $opca = null;
  90. #[ORM\Column(length: 35, nullable: true)]
  91. private ?string $icomNumber = null;
  92. #[ORM\Column(length: 35, nullable: true)]
  93. private ?string $urssafNumber = null;
  94. #[ORM\Column(length: 20, nullable: true)]
  95. private ?string $youngApproval = null;
  96. #[ORM\Column(length: 20, nullable: true)]
  97. private ?string $trainingApproval = null;
  98. #[ORM\Column(length: 50, nullable: true)]
  99. private ?string $otherApproval = null;
  100. #[ORM\Column(length: 35, nullable: true)]
  101. private ?string $prefectureName = null;
  102. #[ORM\Column(length: 20, nullable: true)]
  103. private ?string $prefectureNumber = null;
  104. #[ORM\Column(length: 255, nullable: true)]
  105. #[Assert\Choice(callback: ['\App\Enum\Organization\CategoryEnum', 'toArray'], message: 'invalid-category')]
  106. private ?string $category = null;
  107. #[ORM\Column(length: 255, nullable: true)]
  108. #[Assert\Choice(callback: ['\App\Enum\Organization\SchoolCategoryEnum', 'toArray'], message: 'invalid-school-category')]
  109. private ?string $schoolCategory = null;
  110. #[ORM\Column(length: 255, nullable: true)]
  111. #[Assert\Choice(callback: ['\App\Enum\Organization\TypeEstablishmentEnum', 'toArray'], message: 'invalid-type-establishment')]
  112. private ?string $typeEstablishment = null;
  113. #[ORM\Column(length: 255, nullable: true)]
  114. #[Assert\Choice(callback: ['\App\Enum\Organization\TypeEstablishmentDetailEnum', 'toArray'], message: 'invalid-type-establishment-detail')]
  115. private ?string $typeEstablishmentDetail = null;
  116. #[ORM\Column(nullable: true)]
  117. private ?float $budget = null;
  118. #[ORM\Column(nullable: true)]
  119. private ?bool $isPedagogicIsPrincipalActivity = null;
  120. #[ORM\Column(nullable: true)]
  121. private ?float $pedagogicBudget = null;
  122. #[ORM\Column(nullable: true)]
  123. private ?bool $isPerformanceContractor = null;
  124. #[ORM\Column(length:20, nullable: true)]
  125. private ?string $ffecApproval = null;
  126. #[ORM\Column]
  127. private bool $portailVisibility;
  128. #[ORM\Column(nullable: true)]
  129. private ?int $cmsId = null;
  130. #[ORM\ManyToOne(inversedBy: 'organizationLogos')]
  131. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  132. private ?File $logo = null;
  133. #[ORM\ManyToOne(inversedBy: 'organizationLogos')]
  134. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  135. private ?File $image = null;
  136. #[ORM\ManyToMany(targetEntity: TypeOfPractice::class, mappedBy: 'organizations')]
  137. #[ApiSubresource]
  138. private Collection $typeOfPractices;
  139. #[ORM\Column(nullable: true)]
  140. private ?string $otherPractice = null;
  141. #[ORM\ManyToMany(targetEntity: ContactPoint::class, mappedBy: 'organization')]
  142. #[ApiSubresource]
  143. private Collection $contactPoints;
  144. #[ORM\ManyToMany(targetEntity: BankAccount::class, mappedBy: 'organization')]
  145. #[ApiSubresource]
  146. private Collection $bankAccounts;
  147. #[ORM\OneToMany( mappedBy: 'organization', targetEntity: OrganizationAddressPostal::class, orphanRemoval: true)]
  148. #[ApiSubresource]
  149. private Collection $organizationAddressPostals;
  150. #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationLicence::class, orphanRemoval: true)]
  151. private Collection $organizationLicences;
  152. #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationArticle::class, orphanRemoval: true)]
  153. #[ApiSubresource]
  154. private Collection $organizationArticles;
  155. #[Pure] public function __construct()
  156. {
  157. $this->networkOrganizations = new ArrayCollection();
  158. $this->networkOrganizationChildren = new ArrayCollection();
  159. $this->typeOfPractices = new ArrayCollection();
  160. $this->contactPoints = new ArrayCollection();
  161. $this->bankAccounts = new ArrayCollection();
  162. $this->organizationAddressPostals = new ArrayCollection();
  163. $this->organizationLicences = new ArrayCollection();
  164. $this->organizationArticles = new ArrayCollection();
  165. }
  166. public function getId(): ?int
  167. {
  168. return $this->id;
  169. }
  170. public function getName(): string
  171. {
  172. return $this->name;
  173. }
  174. public function setName(string $name): self
  175. {
  176. $this->name = $name;
  177. return $this;
  178. }
  179. public function getIdentifier(): string
  180. {
  181. return $this->identifier;
  182. }
  183. public function setIdentifier(string $identifier): self
  184. {
  185. $this->identifier = $identifier;
  186. return $this;
  187. }
  188. public function getLegalStatus(): ?string
  189. {
  190. return $this->legalStatus;
  191. }
  192. public function setLegalStatus(?string $legalStatus): self
  193. {
  194. $this->legalStatus = $legalStatus;
  195. return $this;
  196. }
  197. public function getPrincipalType(): ?string
  198. {
  199. return $this->principalType;
  200. }
  201. public function setPrincipalType(?string $principalType): self
  202. {
  203. $this->principalType = $principalType;
  204. return $this;
  205. }
  206. public function getSettings(): Settings
  207. {
  208. return $this->settings;
  209. }
  210. public function setSettings(Settings $settings): self
  211. {
  212. // set the owning side of the relation if necessary
  213. if ($settings->getOrganization() !== $this) {
  214. $settings->setOrganization($this);
  215. }
  216. $this->settings = $settings;
  217. return $this;
  218. }
  219. public function getNetworkOrganizations(): Collection
  220. {
  221. return $this->networkOrganizations;
  222. }
  223. public function addNetworkOrganization(NetworkOrganization $networkOrganization): self
  224. {
  225. if (!$this->networkOrganizations->contains($networkOrganization)) {
  226. $this->networkOrganizations[] = $networkOrganization;
  227. $networkOrganization->setOrganization($this);
  228. }
  229. return $this;
  230. }
  231. public function removeNetworkOrganization(NetworkOrganization $networkOrganization): self
  232. {
  233. if ($this->networkOrganizations->removeElement($networkOrganization)) {
  234. // set the owning side to null (unless already changed)
  235. if ($networkOrganization->getOrganization() === $this) {
  236. $networkOrganization->setOrganization(null);
  237. }
  238. }
  239. return $this;
  240. }
  241. public function getNetworkOrganizationChildren(): Collection
  242. {
  243. return $this->networkOrganizationChildren;
  244. }
  245. public function addNetworkOrganizationChild(NetworkOrganization $networkOrganizationChild): self
  246. {
  247. if (!$this->networkOrganizationChildren->contains($networkOrganizationChild)) {
  248. $this->networkOrganizationChildren[] = $networkOrganizationChild;
  249. $networkOrganizationChild->setParent($this);
  250. }
  251. return $this;
  252. }
  253. public function removeNetworkOrganizationChild(NetworkOrganization $networkOrganizationChild): self
  254. {
  255. if ($this->networkOrganizationChildren->removeElement($networkOrganizationChild)) {
  256. // set the owning side to null (unless already changed)
  257. if ($networkOrganizationChild->getParent() === $this) {
  258. $networkOrganizationChild->setParent(null);
  259. }
  260. }
  261. return $this;
  262. }
  263. public function getParameters(): Parameters
  264. {
  265. return $this->parameters;
  266. }
  267. public function setParameters(Parameters $parameters): self
  268. {
  269. $this->parameters = $parameters;
  270. return $this;
  271. }
  272. /**
  273. * @return File
  274. */
  275. public function getLogo(): File
  276. {
  277. return $this->logo;
  278. }
  279. /**
  280. * @param File $logo
  281. */
  282. public function setLogo(File $logo): void
  283. {
  284. $this->logo = $logo;
  285. }
  286. public function getBillingSetting(): BillingSetting
  287. {
  288. return $this->billingSetting;
  289. }
  290. public function setBillingSetting(BillingSetting $billingSetting): self
  291. {
  292. $this->billingSetting = $billingSetting;
  293. return $this;
  294. }
  295. public function getDescription(): ?string
  296. {
  297. return $this->description;
  298. }
  299. public function setDescription(?string $description): self
  300. {
  301. $this->description = $description;
  302. return $this;
  303. }
  304. public function getCreationDate(): ?\DateTimeInterface
  305. {
  306. return $this->creationDate;
  307. }
  308. public function setCreationDate(?\DateTimeInterface $creationDate): self
  309. {
  310. $this->creationDate = $creationDate;
  311. return $this;
  312. }
  313. public function getDeclarationDate(): ?\DateTimeInterface
  314. {
  315. return $this->declarationDate;
  316. }
  317. public function setDeclarationDate(?\DateTimeInterface $declarationDate): self
  318. {
  319. $this->declarationDate = $declarationDate;
  320. return $this;
  321. }
  322. public function getSiretNumber(): ?string
  323. {
  324. return $this->siretNumber;
  325. }
  326. public function setSiretNumber(?string $siretNumber): self
  327. {
  328. $this->siretNumber = $siretNumber;
  329. return $this;
  330. }
  331. public function getWaldecNumber(): ?string
  332. {
  333. return $this->waldecNumber;
  334. }
  335. public function setWaldecNumber(?string $waldecNumber): self
  336. {
  337. $this->waldecNumber = $waldecNumber;
  338. return $this;
  339. }
  340. public function getApeNumber(): ?string
  341. {
  342. return $this->apeNumber;
  343. }
  344. public function setApeNumber(?string $apeNumber): self
  345. {
  346. $this->apeNumber = $apeNumber;
  347. return $this;
  348. }
  349. public function getTvaNumber(): ?string
  350. {
  351. return $this->tvaNumber;
  352. }
  353. public function setTvaNumber(?string $tvaNumber): self
  354. {
  355. $this->tvaNumber = $tvaNumber;
  356. return $this;
  357. }
  358. public function getOtherType(): ?string
  359. {
  360. return $this->otherType;
  361. }
  362. public function setOtherType(?string $otherType): self
  363. {
  364. $this->otherType = $otherType;
  365. return $this;
  366. }
  367. public function getAcronym(): ?string
  368. {
  369. return $this->acronym;
  370. }
  371. public function setAcronym(?string $acronym): self
  372. {
  373. $this->acronym = $acronym;
  374. return $this;
  375. }
  376. public function getFacebook(): ?string
  377. {
  378. return $this->facebook;
  379. }
  380. public function setFacebook(?string $facebook): self
  381. {
  382. $this->facebook = $facebook;
  383. return $this;
  384. }
  385. public function getTwitter(): ?string
  386. {
  387. return $this->twitter;
  388. }
  389. public function setTwitter(?string $twitter): self
  390. {
  391. $this->twitter = $twitter;
  392. return $this;
  393. }
  394. public function getYoutube(): ?string
  395. {
  396. return $this->youtube;
  397. }
  398. public function setYoutube(?string $youtube): self
  399. {
  400. $this->youtube = $youtube;
  401. return $this;
  402. }
  403. public function getInstagram(): ?string
  404. {
  405. return $this->instagram;
  406. }
  407. public function setInstagram(?string $instagram): self
  408. {
  409. $this->instagram = $instagram;
  410. return $this;
  411. }
  412. public function getCollectiveAgreement(): ?string
  413. {
  414. return $this->collectiveAgreement;
  415. }
  416. public function setCollectiveAgreement(?string $collectiveAgreement): self
  417. {
  418. $this->collectiveAgreement = $collectiveAgreement;
  419. return $this;
  420. }
  421. public function getOpca(): ?string
  422. {
  423. return $this->opca;
  424. }
  425. public function setOpca(?string $opca): self
  426. {
  427. $this->opca = $opca;
  428. return $this;
  429. }
  430. public function getIcomNumber(): ?string
  431. {
  432. return $this->icomNumber;
  433. }
  434. public function setIcomNumber(?string $icomNumber): self
  435. {
  436. $this->icomNumber = $icomNumber;
  437. return $this;
  438. }
  439. public function getUrssafNumber(): ?string
  440. {
  441. return $this->urssafNumber;
  442. }
  443. public function setUrssafNumber(?string $urssafNumber): self
  444. {
  445. $this->urssafNumber = $urssafNumber;
  446. return $this;
  447. }
  448. public function getYoungApproval(): ?string
  449. {
  450. return $this->youngApproval;
  451. }
  452. public function setYoungApproval(?string $youngApproval): self
  453. {
  454. $this->youngApproval = $youngApproval;
  455. return $this;
  456. }
  457. public function getTrainingApproval(): ?string
  458. {
  459. return $this->trainingApproval;
  460. }
  461. public function setTrainingApproval(?string $trainingApproval): self
  462. {
  463. $this->trainingApproval = $trainingApproval;
  464. return $this;
  465. }
  466. public function getOtherApproval(): ?string
  467. {
  468. return $this->otherApproval;
  469. }
  470. public function setOtherApproval(?string $otherApproval): self
  471. {
  472. $this->otherApproval = $otherApproval;
  473. return $this;
  474. }
  475. public function getPrefectureName(): ?string
  476. {
  477. return $this->prefectureName;
  478. }
  479. public function setPrefectureName(?string $prefectureName): self
  480. {
  481. $this->prefectureName = $prefectureName;
  482. return $this;
  483. }
  484. public function getPrefectureNumber(): ?string
  485. {
  486. return $this->prefectureNumber;
  487. }
  488. public function setPrefectureNumber(?string $prefectureNumber): self
  489. {
  490. $this->prefectureNumber = $prefectureNumber;
  491. return $this;
  492. }
  493. public function getCategory(): ?string
  494. {
  495. return $this->category;
  496. }
  497. public function setCategory(?string $category): self
  498. {
  499. $this->category = $category;
  500. return $this;
  501. }
  502. public function getSchoolCategory(): ?string
  503. {
  504. return $this->schoolCategory;
  505. }
  506. public function setSchoolCategory(?string $schoolCategory): self
  507. {
  508. $this->schoolCategory = $schoolCategory;
  509. return $this;
  510. }
  511. public function getTypeEstablishment(): ?string
  512. {
  513. return $this->typeEstablishment;
  514. }
  515. public function setTypeEstablishment(?string $typeEstablishment): self
  516. {
  517. $this->typeEstablishment = $typeEstablishment;
  518. return $this;
  519. }
  520. public function getTypeEstablishmentDetail(): ?string
  521. {
  522. return $this->typeEstablishmentDetail;
  523. }
  524. public function setTypeEstablishmentDetail(?string $typeEstablishmentDetail): self
  525. {
  526. $this->typeEstablishmentDetail = $typeEstablishmentDetail;
  527. return $this;
  528. }
  529. public function getBudget(): ?float
  530. {
  531. return $this->budget;
  532. }
  533. public function setBudget(?float $budget): self
  534. {
  535. $this->budget = $budget;
  536. return $this;
  537. }
  538. public function getIsPedagogicIsPrincipalActivity(): ?bool
  539. {
  540. return $this->isPedagogicIsPrincipalActivity;
  541. }
  542. public function setIsPedagogicIsPrincipalActivity(?bool $isPedagogicIsPrincipalActivity): self
  543. {
  544. $this->isPedagogicIsPrincipalActivity = $isPedagogicIsPrincipalActivity;
  545. return $this;
  546. }
  547. public function getPedagogicBudget(): ?float
  548. {
  549. return $this->pedagogicBudget;
  550. }
  551. public function setPedagogicBudget(?float $pedagogicBudget): self
  552. {
  553. $this->pedagogicBudget = $pedagogicBudget;
  554. return $this;
  555. }
  556. public function getIsPerformanceContractor(): ?bool
  557. {
  558. return $this->isPerformanceContractor;
  559. }
  560. public function setIsPerformanceContractor(?bool $isPerformanceContractor): self
  561. {
  562. $this->isPerformanceContractor = $isPerformanceContractor;
  563. return $this;
  564. }
  565. public function getFfecApproval(): ?string
  566. {
  567. return $this->ffecApproval;
  568. }
  569. public function setFfecApproval(?string $ffecApproval): self
  570. {
  571. $this->ffecApproval = $ffecApproval;
  572. return $this;
  573. }
  574. public function getPortailVisibility(): bool
  575. {
  576. return $this->portailVisibility;
  577. }
  578. public function setPortailVisibility(bool $portailVisibility): self
  579. {
  580. $this->portailVisibility = $portailVisibility;
  581. return $this;
  582. }
  583. public function getCmsId(): ?int
  584. {
  585. return $this->cmsId;
  586. }
  587. public function setCmsId(?int $cmsId): self
  588. {
  589. $this->cmsId = $cmsId;
  590. return $this;
  591. }
  592. public function setImage(?File $image):self
  593. {
  594. $this->image = $image;
  595. return $this;
  596. }
  597. public function getImage(): ?File
  598. {
  599. return $this->image;
  600. }
  601. public function getTypeOfPractices(): Collection
  602. {
  603. return $this->typeOfPractices;
  604. }
  605. public function addTypeOfPractice(TypeOfPractice $typeOfPractice): self
  606. {
  607. if (!$this->typeOfPractices->contains($typeOfPractice)) {
  608. $this->typeOfPractices[] = $typeOfPractice;
  609. $typeOfPractice->addOrganization($this);
  610. }
  611. return $this;
  612. }
  613. public function removeTypeOfPractice(TypeOfPractice $typeOfPractice): self
  614. {
  615. if ($this->typeOfPractices->removeElement($typeOfPractice)) {
  616. $typeOfPractice->removeOrganization($this);
  617. }
  618. return $this;
  619. }
  620. public function getOtherPractice(): ?string
  621. {
  622. return $this->otherPractice;
  623. }
  624. public function setOtherPractice(?string $otherPractice): self
  625. {
  626. $this->otherPractice = $otherPractice;
  627. return $this;
  628. }
  629. public function getContactPoints(): Collection
  630. {
  631. return $this->contactPoints;
  632. }
  633. public function addContactPoint(ContactPoint $contactPoint): self
  634. {
  635. if (!$this->contactPoints->contains($contactPoint)) {
  636. $this->contactPoints[] = $contactPoint;
  637. $contactPoint->addOrganization($this);
  638. }
  639. return $this;
  640. }
  641. public function removeContactPoint(ContactPoint $contactPoint): self
  642. {
  643. if ($this->contactPoints->removeElement($contactPoint)) {
  644. $contactPoint->removeOrganization($this);
  645. }
  646. return $this;
  647. }
  648. public function getBankAccounts(): Collection
  649. {
  650. return $this->bankAccounts;
  651. }
  652. public function addBankAccount(BankAccount $bankAccount): self
  653. {
  654. if (!$this->bankAccounts->contains($bankAccount)) {
  655. $this->bankAccounts[] = $bankAccount;
  656. $bankAccount->addOrganization($this);
  657. }
  658. return $this;
  659. }
  660. public function removeBankAccount(BankAccount $bankAccount): self
  661. {
  662. if ($this->bankAccounts->removeElement($bankAccount)) {
  663. $bankAccount->removeOrganization($this);
  664. }
  665. return $this;
  666. }
  667. public function getOrganizationAddressPostals(): Collection
  668. {
  669. return $this->organizationAddressPostals;
  670. }
  671. public function addOrganizationAddressPostal(OrganizationAddressPostal $organizationAddressPostal): self
  672. {
  673. if (!$this->organizationAddressPostals->contains($organizationAddressPostal)) {
  674. $this->organizationAddressPostals[] = $organizationAddressPostal;
  675. $organizationAddressPostal->setOrganization($this);
  676. }
  677. return $this;
  678. }
  679. public function removeOrganizationAddressPostal(OrganizationAddressPostal $organizationAddressPostal): self
  680. {
  681. if ($this->organizationAddressPostals->removeElement($organizationAddressPostal)) {
  682. // set the owning side to null (unless already changed)
  683. if ($organizationAddressPostal->getOrganization() === $this) {
  684. $organizationAddressPostal->setOrganization(null);
  685. }
  686. }
  687. return $this;
  688. }
  689. public function getOrganizationLicences(): Collection
  690. {
  691. return $this->organizationLicences;
  692. }
  693. public function addOrganizationLicence(OrganizationLicence $organizationLicence): self
  694. {
  695. if (!$this->organizationLicences->contains($organizationLicence)) {
  696. $this->organizationLicences[] = $organizationLicence;
  697. $organizationLicence->setOrganization($this);
  698. }
  699. return $this;
  700. }
  701. public function removeOrganizationLicence(OrganizationLicence $organizationLicence): self
  702. {
  703. if ($this->organizationLicences->removeElement($organizationLicence)) {
  704. // set the owning side to null (unless already changed)
  705. if ($organizationLicence->getOrganization() === $this) {
  706. $organizationLicence->setOrganization(null);
  707. }
  708. }
  709. return $this;
  710. }
  711. public function getOrganizationArticles(): Collection
  712. {
  713. return $this->organizationArticles;
  714. }
  715. public function addOrganizationArticle(OrganizationArticle $organizationArticle): self
  716. {
  717. if (!$this->organizationArticles->contains($organizationArticle)) {
  718. $this->organizationArticles[] = $organizationArticle;
  719. $organizationArticle->setOrganization($this);
  720. }
  721. return $this;
  722. }
  723. public function removeOrganizationArticle(OrganizationArticle $organizationArticle): self
  724. {
  725. if ($this->organizationArticles->removeElement($organizationArticle)) {
  726. // set the owning side to null (unless already changed)
  727. if ($organizationArticle->getOrganization() === $this) {
  728. $organizationArticle->setOrganization(null);
  729. }
  730. }
  731. return $this;
  732. }
  733. }