|
|
@@ -7,8 +7,12 @@ namespace App\Entity\Organization;
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
|
use ApiPlatform\Metadata\Get;
|
|
|
use App\Entity\Access\Access;
|
|
|
+use App\Entity\Billing\BillingExportSetting;
|
|
|
use App\Entity\Billing\BillingSetting;
|
|
|
+use App\Entity\Billing\BillSchedule;
|
|
|
+use App\Entity\Billing\FamilyQuotientModel;
|
|
|
use App\Entity\Booking\Attendance;
|
|
|
+use App\Entity\Booking\AttendanceBookingReason;
|
|
|
use App\Entity\Booking\Course;
|
|
|
use App\Entity\Booking\EducationalProject;
|
|
|
use App\Entity\Booking\Event;
|
|
|
@@ -26,12 +30,13 @@ use App\Entity\Education\EducationCategory;
|
|
|
use App\Entity\Education\EducationNotationConfig;
|
|
|
use App\Entity\Education\EducationTiming;
|
|
|
use App\Entity\Education\PeriodNotation;
|
|
|
+use App\Entity\Message\AbstractMessage;
|
|
|
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\Place\AbstractPlace;
|
|
|
use App\Entity\Product\Equipment;
|
|
|
use App\Entity\Product\Intangible;
|
|
|
use App\Entity\Reward\Reward;
|
|
|
@@ -300,7 +305,7 @@ class Organization
|
|
|
#[ORM\OneToMany(mappedBy: 'organization', targetEntity: Commission::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
|
|
private Collection $commissions;
|
|
|
|
|
|
- #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Place::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
|
|
+ #[ORM\OneToMany(mappedBy: 'organization', targetEntity: AbstractPlace::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
|
|
private Collection $places;
|
|
|
|
|
|
#[ORM\OneToMany(mappedBy: 'organization', targetEntity: Attendance::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
|
|
@@ -327,6 +332,39 @@ class Organization
|
|
|
#[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id')]
|
|
|
private Collection $tags;
|
|
|
|
|
|
+ #[ORM\OneToMany(mappedBy: 'organization', targetEntity: NetworkOrganization::class, cascade: ['persist'], orphanRemoval: true)]
|
|
|
+ protected Collection $network;
|
|
|
+
|
|
|
+ #[ORM\OneToMany(mappedBy: 'parent', targetEntity: NetworkOrganization::class, cascade: ['persist'], orphanRemoval: true)]
|
|
|
+ protected Collection $networkChild;
|
|
|
+
|
|
|
+ #[ORM\OneToOne(mappedBy: 'organization', targetEntity: BillingExportSetting::class, cascade: ['persist'])]
|
|
|
+ protected BillingExportSetting $billingExportSetting;
|
|
|
+
|
|
|
+ #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Access::class, cascade: ['persist'], orphanRemoval: true)]
|
|
|
+ protected Collection $access;
|
|
|
+
|
|
|
+ #[ORM\OneToMany(mappedBy: 'organization', targetEntity: AbstractMessage::class, cascade: [], orphanRemoval: true)]
|
|
|
+ protected Collection $messages;
|
|
|
+
|
|
|
+ #[ORM\OneToOne(mappedBy: 'organization', targetEntity: OnlineRegistrationSettings::class, cascade: ['persist'])]
|
|
|
+ protected OnlineRegistrationSettings $onlineRegistrationSettings;
|
|
|
+
|
|
|
+ #[ORM\OneToMany(mappedBy: 'organization', targetEntity: CotisationByYear::class, cascade: ['persist'], orphanRemoval: true)]
|
|
|
+ protected Collection $cotisationByYears;
|
|
|
+
|
|
|
+ #[ORM\OneToMany(mappedBy: 'organization', targetEntity: AttendanceBookingReason::class, cascade: ['persist'], orphanRemoval: true)]
|
|
|
+ protected Collection $attendanceBookingReasons;
|
|
|
+
|
|
|
+ #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Cycle::class, cascade: [], orphanRemoval: true)]
|
|
|
+ protected Collection $educationCurriculumPacks;
|
|
|
+
|
|
|
+ #[ORM\OneToMany(mappedBy: 'organization', targetEntity: FamilyQuotientModel::class, cascade: [], orphanRemoval: true)]
|
|
|
+ protected Collection $familyQuotientModels;
|
|
|
+
|
|
|
+ #[ORM\OneToMany(mappedBy: 'organization', targetEntity: BillSchedule::class, cascade: ['persist'], orphanRemoval: true)]
|
|
|
+ protected Collection $billSchedules;
|
|
|
+
|
|
|
#[Pure]
|
|
|
public function __construct()
|
|
|
{
|
|
|
@@ -366,6 +404,15 @@ class Organization
|
|
|
$this->donors = new ArrayCollection();
|
|
|
$this->tags = new ArrayCollection();
|
|
|
$this->rewards = new ArrayCollection();
|
|
|
+ $this->network = new ArrayCollection();
|
|
|
+ $this->networkChild = new ArrayCollection();
|
|
|
+ $this->access = new ArrayCollection();
|
|
|
+ $this->messages = new ArrayCollection();
|
|
|
+ $this->cotisationByYears = new ArrayCollection();
|
|
|
+ $this->attendanceBookingReasons = new ArrayCollection();
|
|
|
+ $this->educationCurriculumPacks = new ArrayCollection();
|
|
|
+ $this->familyQuotientModels = new ArrayCollection();
|
|
|
+ $this->billSchedules = new ArrayCollection();
|
|
|
}
|
|
|
|
|
|
public function getId(): ?int
|
|
|
@@ -443,6 +490,25 @@ class Organization
|
|
|
return $this->accesses;
|
|
|
}
|
|
|
|
|
|
+ public function addAccess(Access $access): self
|
|
|
+ {
|
|
|
+ if (!$this->access->contains($access)) {
|
|
|
+ $this->access[] = $access;
|
|
|
+ $access->setOrganization($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function removeAccess(Access $access): self
|
|
|
+ {
|
|
|
+ if ($this->access->removeElement($access)) {
|
|
|
+ $access->setOrganization(null);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
public function getNetworkOrganizations(): Collection
|
|
|
{
|
|
|
return $this->networkOrganizations;
|
|
|
@@ -1212,28 +1278,6 @@ class Organization
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
- 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;
|
|
|
@@ -1661,14 +1705,14 @@ class Organization
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return Collection<int, Place>
|
|
|
+ * @return Collection<int, AbstractPlace>
|
|
|
*/
|
|
|
public function getPlaces(): Collection
|
|
|
{
|
|
|
return $this->places;
|
|
|
}
|
|
|
|
|
|
- public function addPlace(Place $place): self
|
|
|
+ public function addPlace(AbstractPlace $place): self
|
|
|
{
|
|
|
if (!$this->places->contains($place)) {
|
|
|
$this->places[] = $place;
|
|
|
@@ -1678,7 +1722,7 @@ class Organization
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
- public function removePlace(Place $place): self
|
|
|
+ public function removePlace(AbstractPlace $place): self
|
|
|
{
|
|
|
if ($this->places->removeElement($place)) {
|
|
|
// set the owning side to null (unless already changed)
|
|
|
@@ -1870,4 +1914,220 @@ class Organization
|
|
|
|
|
|
return $this;
|
|
|
}
|
|
|
+
|
|
|
+ public function getNetwork(): Collection
|
|
|
+ {
|
|
|
+ return $this->network;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function addNetwork(NetworkOrganization $network): self
|
|
|
+ {
|
|
|
+ if (!$this->network->contains($network)) {
|
|
|
+ $this->network[] = $network;
|
|
|
+ $network->setOrganization($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function removeNetwork(NetworkOrganization $network): self
|
|
|
+ {
|
|
|
+ if ($this->network->removeElement($network)) {
|
|
|
+ $network->setOrganization(null);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getNetworkChild(): Collection
|
|
|
+ {
|
|
|
+ return $this->networkChild;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function addNetworkChild(NetworkOrganization $networkChild): self
|
|
|
+ {
|
|
|
+ if (!$this->networkChild->contains($networkChild)) {
|
|
|
+ $this->networkChild[] = $networkChild;
|
|
|
+ $networkChild->setParent($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function removeNetworkChild(NetworkOrganization $networkChild): self
|
|
|
+ {
|
|
|
+ if ($this->networkChild->removeElement($networkChild)) {
|
|
|
+ $networkChild->setParent(null);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getBillingExportSetting(): BillingExportSetting
|
|
|
+ {
|
|
|
+ return $this->billingExportSetting;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function setBillingExportSetting(BillingExportSetting $billingExportSetting): self
|
|
|
+ {
|
|
|
+ $this->billingExportSetting = $billingExportSetting;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getMessages(): Collection
|
|
|
+ {
|
|
|
+ return $this->messages;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function addMessage(mixed $message): self
|
|
|
+ {
|
|
|
+ if (!$this->messages->contains($message)) {
|
|
|
+ $this->messages[] = $message;
|
|
|
+ $message->setOrganization($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function removeMessage(mixed $message): self
|
|
|
+ {
|
|
|
+ if ($this->messages->removeElement($message)) {
|
|
|
+ $message->setOrganization(null);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getOnlineRegistrationSettings(): OnlineRegistrationSettings
|
|
|
+ {
|
|
|
+ return $this->onlineRegistrationSettings;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function setOnlineRegistrationSettings(OnlineRegistrationSettings $onlineRegistrationSettings): self
|
|
|
+ {
|
|
|
+ $this->onlineRegistrationSettings = $onlineRegistrationSettings;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getCotisationByYears(): Collection
|
|
|
+ {
|
|
|
+ return $this->cotisationByYears;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function addCotisationByYear(CotisationByYear $cotisationByYear): self
|
|
|
+ {
|
|
|
+ if (!$this->cotisationByYears->contains($cotisationByYear)) {
|
|
|
+ $this->cotisationByYears[] = $cotisationByYear;
|
|
|
+ $cotisationByYear->setOrganization($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function removeCotisationByYear(CotisationByYear $cotisationByYear): self
|
|
|
+ {
|
|
|
+ if ($this->cotisationByYears->removeElement($cotisationByYear)) {
|
|
|
+ $cotisationByYear->setOrganization(null);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getAttendanceBookingReasons(): Collection
|
|
|
+ {
|
|
|
+ return $this->attendanceBookingReasons;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function addAttendanceBookingReason(AttendanceBookingReason $attendanceBookingReason): self
|
|
|
+ {
|
|
|
+ if (!$this->attendanceBookingReasons->contains($attendanceBookingReason)) {
|
|
|
+ $this->attendanceBookingReasons[] = $attendanceBookingReason;
|
|
|
+ $attendanceBookingReason->setOrganization($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function removeAttendanceBookingReason(AttendanceBookingReason $attendanceBookingReason): self
|
|
|
+ {
|
|
|
+ if ($this->attendanceBookingReasons->removeElement($attendanceBookingReason)) {
|
|
|
+ $attendanceBookingReason->setOrganization(null);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getEducationCurriculumPacks(): Collection
|
|
|
+ {
|
|
|
+ return $this->educationCurriculumPacks;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function addEducationCurriculumPack(Cycle $educationCurriculumPack): self
|
|
|
+ {
|
|
|
+ if (!$this->educationCurriculumPacks->contains($educationCurriculumPack)) {
|
|
|
+ $this->educationCurriculumPacks[] = $educationCurriculumPack;
|
|
|
+ $educationCurriculumPack->setOrganization($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function removeEducationCurriculumPack(Cycle $educationCurriculumPack): self
|
|
|
+ {
|
|
|
+ if ($this->educationCurriculumPacks->removeElement($educationCurriculumPack)) {
|
|
|
+ $educationCurriculumPack->setOrganization(null);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getFamilyQuotientModels(): Collection
|
|
|
+ {
|
|
|
+ return $this->familyQuotientModels;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function addFamilyQuotientModel(FamilyQuotientModel $familyQuotientModel): self
|
|
|
+ {
|
|
|
+ if (!$this->familyQuotientModels->contains($familyQuotientModel)) {
|
|
|
+ $this->familyQuotientModels[] = $familyQuotientModel;
|
|
|
+ $familyQuotientModel->setOrganization($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function removeFamilyQuotientModel(FamilyQuotientModel $familyQuotientModel): self
|
|
|
+ {
|
|
|
+ if ($this->familyQuotientModels->removeElement($familyQuotientModel)) {
|
|
|
+ // $familyQuotientModel->setOrganization(null); // TODO: actuellement, pas nullable: conserver?
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getBillSchedules(): Collection
|
|
|
+ {
|
|
|
+ return $this->billSchedules;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function addBillSchedule(BillSchedule $billSchedule): self
|
|
|
+ {
|
|
|
+ if (!$this->billSchedules->contains($billSchedule)) {
|
|
|
+ $this->billSchedules[] = $billSchedule;
|
|
|
+ $billSchedule->setOrganization($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function removeBillSchedule(BillSchedule $billSchedule): self
|
|
|
+ {
|
|
|
+ if ($this->billSchedules->removeElement($billSchedule)) {
|
|
|
+ // $billSchedule->setOrganization(null); // TODO: actuellement, pas nullable: conserver?
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
}
|