File.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Core;
  4. use ApiPlatform\Metadata\ApiResource;
  5. use ApiPlatform\Metadata\Delete;
  6. use ApiPlatform\Metadata\Get;
  7. use ApiPlatform\Metadata\Patch;
  8. use ApiPlatform\Metadata\Post;
  9. use ApiPlatform\Metadata\Put;
  10. use App\Entity\AccessWish\DocumentWish;
  11. use App\Entity\Billing\SddRegie;
  12. use App\Entity\Booking\CalendarSynchro;
  13. use App\Entity\Booking\Event;
  14. use App\Entity\Booking\EventReport;
  15. use App\Entity\Booking\Work;
  16. use App\Entity\Message\TemplateSystem;
  17. use App\Entity\Network\Network;
  18. use App\Entity\Organization\Activity;
  19. use App\Entity\Organization\OnlineRegistrationSettings;
  20. use App\Entity\Organization\Organization;
  21. use App\Entity\Organization\Parameters;
  22. use App\Entity\Person\Person;
  23. use App\Enum\Core\FileFolderEnum;
  24. use App\Enum\Core\FileHostEnum;
  25. use App\Enum\Core\FileStatusEnum;
  26. use App\Enum\Core\FileTypeEnum;
  27. use App\Enum\Core\FileVisibilityEnum;
  28. // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
  29. use App\Repository\Core\FileRepository;
  30. use App\State\Processor\Core\FileProcessor;
  31. use Doctrine\Common\Collections\ArrayCollection;
  32. use Doctrine\Common\Collections\Collection;
  33. use Doctrine\ORM\Mapping as ORM;
  34. use JetBrains\PhpStorm\Pure;
  35. use Symfony\Component\Serializer\Annotation\Groups;
  36. /**
  37. * Fichier, généré ou uploadé, appartenant à une organisation ou à une personne.
  38. *
  39. * Security :
  40. *
  41. * * @see App\Security\Voter\FileVoter
  42. */
  43. #[ApiResource(
  44. operations: [
  45. new Get(security: "is_granted('READ', object)"),
  46. new Put(security: "is_granted('EDIT', object)"),
  47. new Patch(security: "is_granted('EDIT', object)"),
  48. new Post(security: "is_granted('CREATE', object)"),
  49. new Delete(security: "is_granted('DELETE', object)"),
  50. ],
  51. processor: FileProcessor::class
  52. )]
  53. // #[Auditable]
  54. #[ORM\Entity(repositoryClass: FileRepository::class)]
  55. class File
  56. {
  57. #[ORM\Id]
  58. #[ORM\Column]
  59. #[ORM\GeneratedValue]
  60. private ?int $id = null;
  61. /**
  62. * Propriétaire du fichier.
  63. */
  64. #[ORM\ManyToOne(inversedBy: 'files')]
  65. #[ORM\JoinColumn(name: 'person_id', referencedColumnName: 'id')]
  66. private ?Person $person;
  67. /**
  68. * Organisation propriétaire du fichier.
  69. */
  70. #[ORM\ManyToOne(inversedBy: 'files')]
  71. #[ORM\JoinColumn(name: 'organization_id', referencedColumnName: 'id')]
  72. private ?Organization $organization;
  73. /**
  74. * Slug du fichier (i.e. le chemin d'accès relatif).
  75. */
  76. #[ORM\Column(length: 255, nullable: true)]
  77. private ?string $slug;
  78. /**
  79. * Nom du fichier.
  80. */
  81. #[ORM\Column(length: 255)]
  82. private string $name;
  83. /**
  84. * Mimetype du fichier.
  85. */
  86. #[ORM\Column(length: 255, nullable: true)]
  87. private ?string $mimeType = null;
  88. /**
  89. * Visibilité du fichier (tout le monde, personne, l'organisation seulement...).
  90. */
  91. #[ORM\Column(length: 24, enumType: FileVisibilityEnum::class, options: ['default' => FileVisibilityEnum::NOBODY])]
  92. private FileVisibilityEnum $visibility = FileVisibilityEnum::NOBODY;
  93. /**
  94. * Configuration particulière associée au fichier (exemple: image recadrée).
  95. */
  96. #[ORM\Column(type: 'text', length: 255, nullable: true)]
  97. private ?string $config;
  98. /**
  99. * Type de document (uploaded, mail, bill...etc).
  100. */
  101. #[ORM\Column(length: 50, enumType: FileTypeEnum::class, options: ['default' => FileTypeEnum::NONE])]
  102. private FileTypeEnum $type = FileTypeEnum::NONE;
  103. /**
  104. * Taille du document en octets.
  105. */
  106. #[ORM\Column(nullable: true)]
  107. private ?int $size;
  108. /**
  109. * Un fichier est temporaire par exemple s'il a été généré et est stocké pour être téléchargé dans la foulée
  110. * Les fichiers temporaires peuvent être supprimés sans risque, à l'inverse des fichiers uploadés par les
  111. * utilisateurs par exemple.
  112. */
  113. #[ORM\Column(options: ['default' => false])]
  114. private bool $isTemporaryFile = false;
  115. /**
  116. * Date de création du fichier.
  117. */
  118. #[ORM\Column]
  119. private \DateTime $createDate;
  120. /**
  121. * Id de l'access ayant créé ce fichier.
  122. */
  123. #[ORM\Column(nullable: true, options: ['default' => null])]
  124. private ?int $createdBy = null;
  125. /**
  126. * Date de dernière mise à jour du fichier.
  127. */
  128. #[ORM\Column(nullable: true, options: ['default' => null])]
  129. private ?\DateTime $updateDate = null;
  130. /**
  131. * Id de l'access ayant mis à jour ce fichier le dernier.
  132. */
  133. #[ORM\Column(nullable: true, options: ['default' => null])]
  134. private ?int $updatedBy = null;
  135. /**
  136. * Statut du fichier (en cours de génération, prêt, supprimé, etc.).
  137. */
  138. #[ORM\Column(length: 50, enumType: FileStatusEnum::class)]
  139. private FileStatusEnum $status;
  140. /**
  141. * Serveur sur lequel le fichier est physiquement stocké.
  142. */
  143. #[ORM\Column(length: 5, enumType: FileHostEnum::class, options: ['default' => FileHostEnum::AP2I])]
  144. private FileHostEnum $host = FileHostEnum::AP2I;
  145. /**
  146. * Dossier dans lequel le fichier est stocké, conçu en prévision de la gestion documentaire.
  147. */
  148. #[ORM\Column(length: 20, enumType: FileFolderEnum::class, options: ['default' => FileFolderEnum::UNRATED], nullable: true)]
  149. private ?FileFolderEnum $folder = FileFolderEnum::UNRATED;
  150. // #[ORM\Column]
  151. // private ?int $eventReport_id;
  152. /**
  153. * TODO: complete.
  154. */
  155. #[ORM\Column(nullable: true, options: ['default' => null])]
  156. private ?\DateTime $availabilityDate = null;
  157. // #[ORM\Column]
  158. // private ?int $documentWish_id;
  159. //
  160. // #[ORM\Column]
  161. // private ?int $onlineRegistrationSetting_id;
  162. //
  163. // #[ORM\Column]
  164. // private ?int $templateSystem_id;
  165. //
  166. // #[ORM\Column]
  167. // private ?int $work_id;
  168. /** @var Collection<int, Person> */
  169. #[ORM\ManyToMany(targetEntity: Person::class, inversedBy: 'personFiles')]
  170. #[Groups(['file_person'])]
  171. private Collection $accessPersons;
  172. /** @var Collection<int, Person> */
  173. #[ORM\OneToMany(targetEntity: Person::class, mappedBy: 'image', orphanRemoval: true)]
  174. private Collection $personImages;
  175. /** @var Collection<int, Organization> */
  176. #[ORM\OneToMany(targetEntity: Organization::class, mappedBy: 'logo', orphanRemoval: true)]
  177. private Collection $organizationLogos;
  178. /** @var Collection<int, Organization> */
  179. #[ORM\OneToMany(targetEntity: Organization::class, mappedBy: 'image', orphanRemoval: true)]
  180. private Collection $organizationImages;
  181. #[ORM\OneToOne(targetEntity: Parameters::class, mappedBy: 'qrCode', fetch: 'EAGER')]
  182. private ?Parameters $qrCode = null;
  183. /** @var Collection<int, Event> */
  184. #[ORM\OneToMany(targetEntity: Event::class, mappedBy: 'image')]
  185. private Collection $events;
  186. /** @var Collection<int, Activity> */
  187. #[ORM\OneToMany(targetEntity: Activity::class, mappedBy: 'logo')]
  188. private Collection $activityLogos;
  189. /** @var Collection<int, Activity> */
  190. #[ORM\OneToMany(targetEntity: Activity::class, mappedBy: 'imageActivity')]
  191. private Collection $activityImages;
  192. #[ORM\ManyToOne(inversedBy: 'files')]
  193. #[ORM\JoinColumn(onDelete: 'CASCADE')]
  194. private ?EventReport $eventReport = null;
  195. #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'files')]
  196. #[ORM\JoinColumn(onDelete: 'CASCADE')]
  197. private ?DocumentWish $documentWish = null;
  198. #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'introductionFiles')]
  199. #[ORM\JoinColumn(onDelete: 'CASCADE')]
  200. private ?OnlineRegistrationSettings $onlineRegistrationSetting = null;
  201. #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'introductionFilesNewEnrolments')]
  202. #[ORM\JoinColumn(onDelete: 'CASCADE')]
  203. private ?OnlineRegistrationSettings $onlineRegistrationSettingNewEnrolments = null;
  204. #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'files')]
  205. #[ORM\JoinColumn(onDelete: 'CASCADE')]
  206. private ?Work $work = null;
  207. #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'files')]
  208. #[ORM\JoinColumn(onDelete: 'CASCADE')]
  209. private ?TemplateSystem $templateSystem = null;
  210. /** @var Collection<int, Network> */
  211. #[ORM\OneToMany(targetEntity: Network::class, mappedBy: 'image')]
  212. private Collection $networks;
  213. #[ORM\OneToOne(targetEntity: CalendarSynchro::class, mappedBy: 'file')]
  214. private ?CalendarSynchro $calendarSynchro;
  215. #[ORM\OneToOne(targetEntity: SddRegie::class, mappedBy: 'file')]
  216. private ?SddRegie $sddRegieFile = null;
  217. #[ORM\OneToOne(targetEntity: SddRegie::class, mappedBy: 'bordereau')]
  218. private ?SddRegie $sddRegieBordereau = null;
  219. #[Pure]
  220. public function __construct()
  221. {
  222. $this->personImages = new ArrayCollection();
  223. $this->organizationLogos = new ArrayCollection();
  224. $this->organizationImages = new ArrayCollection();
  225. $this->accessPersons = new ArrayCollection();
  226. $this->events = new ArrayCollection();
  227. $this->activityLogos = new ArrayCollection();
  228. $this->activityImages = new ArrayCollection();
  229. $this->networks = new ArrayCollection();
  230. }
  231. public function getId(): ?int
  232. {
  233. return $this->id;
  234. }
  235. public function getPerson(): ?Person
  236. {
  237. return $this->person;
  238. }
  239. public function setPerson(?Person $person): self
  240. {
  241. $this->person = $person;
  242. return $this;
  243. }
  244. public function getOrganization(): ?Organization
  245. {
  246. return $this->organization;
  247. }
  248. public function setOrganization(?Organization $organization): self
  249. {
  250. $this->organization = $organization;
  251. return $this;
  252. }
  253. public function getSlug(): ?string
  254. {
  255. return $this->slug;
  256. }
  257. public function setSlug(?string $slug): self
  258. {
  259. $this->slug = $slug;
  260. return $this;
  261. }
  262. /**
  263. * @deprecated
  264. */
  265. public function getPath(): ?string
  266. {
  267. return $this->slug;
  268. }
  269. public function setPath(?string $path): self
  270. {
  271. throw new \Exception('Deprecated : use setSlug instead');
  272. }
  273. public function getName(): string
  274. {
  275. return $this->name;
  276. }
  277. public function setName(string $name): self
  278. {
  279. $this->name = $name;
  280. return $this;
  281. }
  282. public function getMimeType(): ?string
  283. {
  284. return $this->mimeType;
  285. }
  286. public function setMimeType(?string $mimeType): self
  287. {
  288. $this->mimeType = $mimeType;
  289. return $this;
  290. }
  291. public function getConfig(): ?string
  292. {
  293. return $this->config;
  294. }
  295. public function setConfig(?string $config): self
  296. {
  297. $this->config = $config;
  298. return $this;
  299. }
  300. public function getPersonImages(): Collection
  301. {
  302. return $this->personImages;
  303. }
  304. public function addPersonImage(Person $person): self
  305. {
  306. if (!$this->personImages->contains($person)) {
  307. $this->personImages[] = $person;
  308. $person->setImage($this);
  309. }
  310. return $this;
  311. }
  312. public function removePersonImage(Person $person): self
  313. {
  314. // set the owning side to null (unless already changed)
  315. if ($this->personImages->removeElement($person) && $person->getImage() === $this) {
  316. $person->setImage(null);
  317. }
  318. return $this;
  319. }
  320. /**
  321. * TODO: voir si utilisé?
  322. */
  323. public function getAccessRoles(): Collection
  324. {
  325. return new ArrayCollection([]);
  326. }
  327. public function getVisibility(): FileVisibilityEnum
  328. {
  329. return $this->visibility;
  330. }
  331. public function setVisibility(FileVisibilityEnum $visibility): self
  332. {
  333. $this->visibility = $visibility;
  334. return $this;
  335. }
  336. public function getType(): FileTypeEnum
  337. {
  338. return $this->type;
  339. }
  340. public function setType(FileTypeEnum $type): self
  341. {
  342. $this->type = $type;
  343. return $this;
  344. }
  345. public function getSize(): ?int
  346. {
  347. return $this->size;
  348. }
  349. public function setSize(?int $size): self
  350. {
  351. $this->size = $size;
  352. return $this;
  353. }
  354. public function getIsTemporaryFile(): bool
  355. {
  356. return $this->isTemporaryFile;
  357. }
  358. public function setIsTemporaryFile(bool $isTemporaryFile): self
  359. {
  360. $this->isTemporaryFile = $isTemporaryFile;
  361. return $this;
  362. }
  363. public function getCreateDate(): \DateTime
  364. {
  365. return $this->createDate;
  366. }
  367. public function setCreateDate(\DateTime $createDate): self
  368. {
  369. $this->createDate = $createDate;
  370. return $this;
  371. }
  372. public function getCreatedBy(): ?int
  373. {
  374. return $this->createdBy;
  375. }
  376. public function setCreatedBy(?int $createdBy): self
  377. {
  378. $this->createdBy = $createdBy;
  379. return $this;
  380. }
  381. public function getUpdateDate(): \DateTime
  382. {
  383. return $this->updateDate;
  384. }
  385. public function setUpdateDate(\DateTime $updateDate): self
  386. {
  387. $this->updateDate = $updateDate;
  388. return $this;
  389. }
  390. public function getUpdatedBy(): ?int
  391. {
  392. return $this->updatedBy;
  393. }
  394. public function setUpdatedBy(?int $updatedBy): self
  395. {
  396. $this->updatedBy = $updatedBy;
  397. return $this;
  398. }
  399. public function getStatus(): ?FileStatusEnum
  400. {
  401. return $this->status;
  402. }
  403. public function setStatus(?FileStatusEnum $status): self
  404. {
  405. $this->status = $status;
  406. return $this;
  407. }
  408. public function getHost(): ?FileHostEnum
  409. {
  410. return $this->host;
  411. }
  412. public function setHost(?FileHostEnum $host): self
  413. {
  414. $this->host = $host;
  415. return $this;
  416. }
  417. public function getFolder(): ?FileFolderEnum
  418. {
  419. return $this->folder;
  420. }
  421. public function setFolder(?FileFolderEnum $folder): self
  422. {
  423. $this->folder = $folder;
  424. return $this;
  425. }
  426. public function getOrganizationLogos(): Collection
  427. {
  428. return $this->organizationLogos;
  429. }
  430. public function addOrganizationLogo(Organization $organization): self
  431. {
  432. if (!$this->organizationLogos->contains($organization)) {
  433. $this->organizationLogos[] = $organization;
  434. $organization->setLogo($this);
  435. }
  436. return $this;
  437. }
  438. public function removeOrganizationLogo(Organization $organization): self
  439. {
  440. // set the owning side to null (unless already changed)
  441. if ($this->organizationLogos->removeElement($organization) && $organization->getLogo() === $this) {
  442. $organization->setLogo(null);
  443. }
  444. return $this;
  445. }
  446. public function getOrganizationImages(): Collection
  447. {
  448. return $this->organizationImages;
  449. }
  450. public function addOrganizationImage(Organization $organization): self
  451. {
  452. if (!$this->organizationImages->contains($organization)) {
  453. $this->organizationImages[] = $organization;
  454. $organization->setImage($this);
  455. }
  456. return $this;
  457. }
  458. public function removeOrganizationImage(Organization $organization): self
  459. {
  460. // set the owning side to null (unless already changed)
  461. if ($this->organizationImages->removeElement($organization) && $organization->getImage() === $this) {
  462. $organization->setImage(null);
  463. }
  464. return $this;
  465. }
  466. public function getQrCode(): ?Parameters
  467. {
  468. return $this->qrCode;
  469. }
  470. public function setQrCode(?Parameters $qrCode): self
  471. {
  472. $this->qrCode = $qrCode;
  473. return $this;
  474. }
  475. public function getAvailabilityDate(): ?\DateTime
  476. {
  477. return $this->availabilityDate;
  478. }
  479. public function setAvailabilityDate(?\DateTime $availabilityDate): void
  480. {
  481. $this->availabilityDate = $availabilityDate;
  482. }
  483. /**
  484. * @return Collection<int, Person>
  485. */
  486. public function getAccessPersons(): Collection
  487. {
  488. return $this->accessPersons;
  489. }
  490. public function addAccessPerson(Person $accessPerson): self
  491. {
  492. if (!$this->accessPersons->contains($accessPerson)) {
  493. $this->accessPersons[] = $accessPerson;
  494. }
  495. return $this;
  496. }
  497. public function removeAccessPerson(Person $accessPerson): self
  498. {
  499. $this->accessPersons->removeElement($accessPerson);
  500. return $this;
  501. }
  502. /**
  503. * @return Collection<int, Event>
  504. */
  505. public function getEvents(): Collection
  506. {
  507. return $this->events;
  508. }
  509. public function addEvent(Event $event): self
  510. {
  511. if (!$this->events->contains($event)) {
  512. $this->events[] = $event;
  513. $event->setImage($this);
  514. }
  515. return $this;
  516. }
  517. public function removeEvent(Event $event): self
  518. {
  519. // set the owning side to null (unless already changed)
  520. if ($this->events->removeElement($event) && $event->getImage() === $this) {
  521. $event->setImage(null);
  522. }
  523. return $this;
  524. }
  525. /**
  526. * @return Collection<int, Activity>
  527. */
  528. public function getActivityLogos(): Collection
  529. {
  530. return $this->activityLogos;
  531. }
  532. public function addActivityLogo(Activity $activityLogo): self
  533. {
  534. if (!$this->activityLogos->contains($activityLogo)) {
  535. $this->activityLogos[] = $activityLogo;
  536. $activityLogo->setLogo($this);
  537. }
  538. return $this;
  539. }
  540. public function removeActivityLogo(Activity $activityLogo): self
  541. {
  542. // set the owning side to null (unless already changed)
  543. if ($this->activityLogos->removeElement($activityLogo) && $activityLogo->getLogo() === $this) {
  544. $activityLogo->setLogo(null);
  545. }
  546. return $this;
  547. }
  548. /**
  549. * @return Collection<int, Activity>
  550. */
  551. public function getActivityImages(): Collection
  552. {
  553. return $this->activityImages;
  554. }
  555. public function addActivityImage(Activity $activityImage): self
  556. {
  557. if (!$this->activityImages->contains($activityImage)) {
  558. $this->activityImages[] = $activityImage;
  559. $activityImage->setImageActivity($this);
  560. }
  561. return $this;
  562. }
  563. public function removeActivityImage(Activity $activityImage): self
  564. {
  565. // set the owning side to null (unless already changed)
  566. if ($this->activityImages->removeElement($activityImage) && $activityImage->getImageActivity() === $this) {
  567. $activityImage->setImageActivity(null);
  568. }
  569. return $this;
  570. }
  571. public function getEventReport(): ?EventReport
  572. {
  573. return $this->eventReport;
  574. }
  575. public function setEventReport(?EventReport $eventReport): self
  576. {
  577. $this->eventReport = $eventReport;
  578. return $this;
  579. }
  580. public function getDocumentWish(): ?DocumentWish
  581. {
  582. return $this->documentWish;
  583. }
  584. public function setDocumentWish(?DocumentWish $documentWish): self
  585. {
  586. $this->documentWish = $documentWish;
  587. return $this;
  588. }
  589. public function getOnlineRegistrationSetting(): ?OnlineRegistrationSettings
  590. {
  591. return $this->onlineRegistrationSetting;
  592. }
  593. public function setOnlineRegistrationSetting(?OnlineRegistrationSettings $onlineRegistrationSetting): self
  594. {
  595. $this->onlineRegistrationSetting = $onlineRegistrationSetting;
  596. return $this;
  597. }
  598. public function getOnlineRegistrationSettingNewEnrolments(): ?OnlineRegistrationSettings
  599. {
  600. return $this->onlineRegistrationSettingNewEnrolments;
  601. }
  602. public function setOnlineRegistrationSettingNewEnrolments(?OnlineRegistrationSettings $onlineRegistrationSettingNewEnrolments): self
  603. {
  604. $this->onlineRegistrationSettingNewEnrolments = $onlineRegistrationSettingNewEnrolments;
  605. return $this;
  606. }
  607. public function getWork(): ?Work
  608. {
  609. return $this->work;
  610. }
  611. public function setWork(?Work $work): self
  612. {
  613. $this->work = $work;
  614. return $this;
  615. }
  616. public function getTemplateSystem(): ?TemplateSystem
  617. {
  618. return $this->templateSystem;
  619. }
  620. public function setTemplateSystem(?TemplateSystem $templateSystem): self
  621. {
  622. $this->templateSystem = $templateSystem;
  623. return $this;
  624. }
  625. public function getNetworks(): Collection
  626. {
  627. return $this->networks;
  628. }
  629. public function addNetwork(Network $network): self
  630. {
  631. if (!$this->networks->contains($network)) {
  632. $this->networks[] = $network;
  633. $network->setImage($this);
  634. }
  635. return $this;
  636. }
  637. public function removeNetwork(Network $network): self
  638. {
  639. if ($this->networks->removeElement($network)) {
  640. // $network->setImage(null); // TODO: actuellement, pas nullable: conserver?
  641. }
  642. return $this;
  643. }
  644. public function getCalendarSynchro(): ?CalendarSynchro
  645. {
  646. return $this->calendarSynchro;
  647. }
  648. public function setCalendarSynchro(?CalendarSynchro $calendarSynchro): self
  649. {
  650. $this->calendarSynchro = $calendarSynchro;
  651. return $this;
  652. }
  653. public function getSddRegieFile(): ?SddRegie
  654. {
  655. return $this->sddRegieFile;
  656. }
  657. public function setSddRegieFile(?SddRegie $sddRegieFile): self
  658. {
  659. $this->sddRegieFile = $sddRegieFile;
  660. return $this;
  661. }
  662. public function getSddRegieBordereau(): ?SddRegie
  663. {
  664. return $this->sddRegieBordereau;
  665. }
  666. public function setSddRegieBordereau(?SddRegie $sddRegieBordereau): self
  667. {
  668. $this->sddRegieBordereau = $sddRegieBordereau;
  669. return $this;
  670. }
  671. }