Просмотр исходного кода

complete entities constructors with collections initialization

Olivier Massot 1 год назад
Родитель
Сommit
9995d6a4c9

+ 1 - 0
src/Entity/AccessWish/AccessFamilyWish.php

@@ -42,6 +42,7 @@ class AccessFamilyWish
     public function __construct()
     public function __construct()
     {
     {
         $this->accessWishes = new ArrayCollection();
         $this->accessWishes = new ArrayCollection();
+        $this->accessWishesGuardians = new ArrayCollection();
     }
     }
 
 
     public function getId(): ?int
     public function getId(): ?int

+ 6 - 0
src/Entity/AccessWish/EducationStudentWish.php

@@ -14,6 +14,7 @@ use App\Entity\Education\EducationTiming;
 use App\Entity\Product\EquipmentList;
 use App\Entity\Product\EquipmentList;
 use App\Enum\OnlineRegistration\RegistrationStatusEnum;
 use App\Enum\OnlineRegistration\RegistrationStatusEnum;
 use App\Enum\OnlineRegistration\WishRegistrationEnum;
 use App\Enum\OnlineRegistration\WishRegistrationEnum;
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 use Doctrine\ORM\Mapping as ORM;
 
 
@@ -68,6 +69,11 @@ class EducationStudentWish
     #[ORM\JoinColumn(referencedColumnName: 'id', nullable: false, onDelete: 'SET NULL')]
     #[ORM\JoinColumn(referencedColumnName: 'id', nullable: false, onDelete: 'SET NULL')]
     protected Course $course;
     protected Course $course;
 
 
+    public function __construct()
+    {
+        $this->teachers = new ArrayCollection();
+    }
+
     public function getId(): ?int
     public function getId(): ?int
     {
     {
         return $this->id;
         return $this->id;

+ 6 - 0
src/Entity/Billing/BillingExportSetting.php

@@ -7,6 +7,7 @@ namespace App\Entity\Billing;
 // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
 // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
 use App\Entity\Access\Access;
 use App\Entity\Access\Access;
 use App\Entity\Organization\Organization;
 use App\Entity\Organization\Organization;
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 use Doctrine\ORM\Mapping as ORM;
 
 
@@ -32,6 +33,11 @@ class BillingExportSetting
     #[ORM\ManyToMany(targetEntity: Access::class, cascade: [], orphanRemoval: false)]
     #[ORM\ManyToMany(targetEntity: Access::class, cascade: [], orphanRemoval: false)]
     protected Collection $stageManagers;
     protected Collection $stageManagers;
 
 
+    public function __construct()
+    {
+        $this->stageManagers = new ArrayCollection();
+    }
+
     public function getId(): ?int
     public function getId(): ?int
     {
     {
         return $this->id;
         return $this->id;

+ 2 - 0
src/Entity/Billing/SddBank.php

@@ -6,6 +6,7 @@ namespace App\Entity\Billing;
 
 
 // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
 // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
 use App\Entity\Core\File;
 use App\Entity\Core\File;
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 use Doctrine\ORM\Mapping as ORM;
 
 
@@ -29,6 +30,7 @@ class SddBank
 
 
     public function __construct()
     public function __construct()
     {
     {
+        $this->billPayments = new ArrayCollection();
     }
     }
 
 
     public function getId(): ?int
     public function getId(): ?int

+ 2 - 0
src/Entity/Billing/SddRegie.php

@@ -6,6 +6,7 @@ namespace App\Entity\Billing;
 
 
 // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
 // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
 use App\Entity\Core\File;
 use App\Entity\Core\File;
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 use Doctrine\ORM\Mapping as ORM;
 
 
@@ -32,6 +33,7 @@ class SddRegie
 
 
     public function __construct()
     public function __construct()
     {
     {
+        $this->billPayments = new ArrayCollection();
     }
     }
 
 
     public function getId(): ?int
     public function getId(): ?int

+ 8 - 0
src/Entity/Booking/AbstractBooking.php

@@ -11,6 +11,7 @@ use App\Entity\Core\Tagg;
 use App\Entity\Product\Equipment;
 use App\Entity\Product\Equipment;
 use App\Entity\Traits\ActivityYearTrait;
 use App\Entity\Traits\ActivityYearTrait;
 use App\Enum\Booking\VisibilityEnum;
 use App\Enum\Booking\VisibilityEnum;
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 use Doctrine\ORM\Mapping as ORM;
 
 
@@ -53,6 +54,13 @@ abstract class AbstractBooking
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'bookings', cascade: ['persist'], orphanRemoval: false)]
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'bookings', cascade: ['persist'], orphanRemoval: false)]
     protected Collection $tags;
     protected Collection $tags;
 
 
+    public function __construct()
+    {
+        $this->organizer = new ArrayCollection();
+        $this->equipments = new ArrayCollection();
+        $this->tags = new ArrayCollection();
+    }
+
     public function getId(): ?int
     public function getId(): ?int
     {
     {
         return $this->id;
         return $this->id;

+ 1 - 0
src/Entity/Booking/Course.php

@@ -112,6 +112,7 @@ class Course extends AbstractBooking
         $this->equipments = new ArrayCollection();
         $this->equipments = new ArrayCollection();
         $this->attendanceBooking = new ArrayCollection();
         $this->attendanceBooking = new ArrayCollection();
         $this->tags = new ArrayCollection();
         $this->tags = new ArrayCollection();
+        $this->educationStudentWishes = new ArrayCollection();
     }
     }
 
 
     public function getDiscr(): ?string
     public function getDiscr(): ?string

+ 1 - 0
src/Entity/Booking/EducationalProject.php

@@ -117,6 +117,7 @@ class EducationalProject extends AbstractBooking
         $this->attendanceBooking = new ArrayCollection();
         $this->attendanceBooking = new ArrayCollection();
         $this->organizer = new ArrayCollection();
         $this->organizer = new ArrayCollection();
         $this->tags = new ArrayCollection();
         $this->tags = new ArrayCollection();
+        $this->equipments = new ArrayCollection();
     }
     }
 
 
     public function getDiscr(): ?string
     public function getDiscr(): ?string

+ 2 - 0
src/Entity/Booking/Event.php

@@ -112,6 +112,8 @@ class Event extends AbstractBooking
         $this->attendanceBooking = new ArrayCollection();
         $this->attendanceBooking = new ArrayCollection();
         $this->organizer = new ArrayCollection();
         $this->organizer = new ArrayCollection();
         $this->tags = new ArrayCollection();
         $this->tags = new ArrayCollection();
+        $this->equipments = new ArrayCollection();
+        parent::__construct();
     }
     }
 
 
     public function getDiscr(): ?string
     public function getDiscr(): ?string

+ 3 - 0
src/Entity/Booking/Examen.php

@@ -92,6 +92,9 @@ class Examen extends AbstractBooking
         $this->convocation = new ArrayCollection();
         $this->convocation = new ArrayCollection();
         $this->attendanceBooking = new ArrayCollection();
         $this->attendanceBooking = new ArrayCollection();
         $this->tags = new ArrayCollection();
         $this->tags = new ArrayCollection();
+        $this->organizer = new ArrayCollection();
+        $this->equipments = new ArrayCollection();
+        parent::__construct();
     }
     }
 
 
     public function getDiscr(): ?string
     public function getDiscr(): ?string

+ 4 - 0
src/Entity/Booking/OrganizationHoliday.php

@@ -47,6 +47,10 @@ class OrganizationHoliday extends AbstractBooking
     public function __construct()
     public function __construct()
     {
     {
         $this->eventRecur = new ArrayCollection();
         $this->eventRecur = new ArrayCollection();
+        $this->organizer = new ArrayCollection();
+        $this->equipments = new ArrayCollection();
+        $this->tags = new ArrayCollection();
+        parent::__construct();
     }
     }
 
 
     public function getDiscr(): ?string
     public function getDiscr(): ?string

+ 4 - 0
src/Entity/Booking/PersonHoliday.php

@@ -50,6 +50,10 @@ class PersonHoliday extends AbstractBooking
     public function __construct()
     public function __construct()
     {
     {
         $this->eventRecur = new ArrayCollection();
         $this->eventRecur = new ArrayCollection();
+        $this->organizer = new ArrayCollection();
+        $this->equipments = new ArrayCollection();
+        $this->tags = new ArrayCollection();
+        parent::__construct();
     }
     }
 
 
     public function getDiscr(): ?string
     public function getDiscr(): ?string

+ 6 - 0
src/Entity/Core/AbstractControl.php

@@ -5,6 +5,7 @@ declare(strict_types=1);
 namespace App\Entity\Core;
 namespace App\Entity\Core;
 
 
 use App\Entity\Access\Access;
 use App\Entity\Access\Access;
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 use Doctrine\ORM\Mapping as ORM;
 
 
@@ -23,6 +24,11 @@ abstract class AbstractControl
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'controls', cascade: ['persist'], orphanRemoval: false)]
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'controls', cascade: ['persist'], orphanRemoval: false)]
     protected Collection $tags;
     protected Collection $tags;
 
 
+    public function __construct()
+    {
+        $this->tags = new ArrayCollection();
+    }
+
     public function getId(): ?int
     public function getId(): ?int
     {
     {
         return $this->id;
         return $this->id;

+ 6 - 0
src/Entity/Core/AbstractRepair.php

@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 
 namespace App\Entity\Core;
 namespace App\Entity\Core;
 
 
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 use Doctrine\ORM\Mapping as ORM;
 
 
@@ -18,6 +19,11 @@ abstract class AbstractRepair
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'repairs', cascade: ['persist'], orphanRemoval: false)]
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'repairs', cascade: ['persist'], orphanRemoval: false)]
     protected Collection $tags;
     protected Collection $tags;
 
 
+    public function __construct()
+    {
+        $this->tags = new ArrayCollection();
+    }
+
     public function getId(): ?int
     public function getId(): ?int
     {
     {
         return $this->id;
         return $this->id;

+ 1 - 0
src/Entity/Core/AddressPostal.php

@@ -84,6 +84,7 @@ class AddressPostal
     public function __construct()
     public function __construct()
     {
     {
         $this->places = new ArrayCollection();
         $this->places = new ArrayCollection();
+        $this->organizationAddressPostals = new ArrayCollection();
     }
     }
 
 
     public function getId(): ?int
     public function getId(): ?int

+ 7 - 0
src/Entity/Core/Tagg.php

@@ -186,6 +186,13 @@ class Tagg
         $this->emails = new ArrayCollection();
         $this->emails = new ArrayCollection();
         $this->mails = new ArrayCollection();
         $this->mails = new ArrayCollection();
         $this->sms = new ArrayCollection();
         $this->sms = new ArrayCollection();
+        $this->products = new ArrayCollection();
+        $this->bookings = new ArrayCollection();
+        $this->messages = new ArrayCollection();
+        $this->repairs = new ArrayCollection();
+        $this->controls = new ArrayCollection();
+        $this->educationCurriculumPacks = new ArrayCollection();
+
     }
     }
 
 
     public function getId(): ?int
     public function getId(): ?int

+ 1 - 0
src/Entity/Education/Cycle.php

@@ -71,6 +71,7 @@ class Cycle
     public function __construct()
     public function __construct()
     {
     {
         $this->cycleByEducations = new ArrayCollection();
         $this->cycleByEducations = new ArrayCollection();
+        $this->educationCurriculums = new ArrayCollection();
     }
     }
 
 
     public function getId(): ?int
     public function getId(): ?int

+ 1 - 0
src/Entity/Education/Education.php

@@ -71,6 +71,7 @@ class Education
         $this->examens = new ArrayCollection();
         $this->examens = new ArrayCollection();
         $this->educationTeachers = new ArrayCollection();
         $this->educationTeachers = new ArrayCollection();
         $this->tags = new ArrayCollection();
         $this->tags = new ArrayCollection();
+        $this->educationWishes = new ArrayCollection();
     }
     }
 
 
     public function getId(): ?int
     public function getId(): ?int

+ 6 - 0
src/Entity/Education/EducationComplement.php

@@ -5,6 +5,7 @@ declare(strict_types=1);
 namespace App\Entity\Education;
 namespace App\Entity\Education;
 
 
 // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
 // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 use Doctrine\ORM\Mapping as ORM;
 
 
@@ -23,6 +24,11 @@ class EducationComplement
     #[ORM\OneToMany(mappedBy: 'educationComplement', targetEntity: Education::class, cascade: [], orphanRemoval: true)]
     #[ORM\OneToMany(mappedBy: 'educationComplement', targetEntity: Education::class, cascade: [], orphanRemoval: true)]
     protected Collection $educations;
     protected Collection $educations;
 
 
+    public function __construct()
+    {
+        $this->educations = new ArrayCollection();
+    }
+
     public function getId(): ?int
     public function getId(): ?int
     {
     {
         return $this->id;
         return $this->id;

+ 7 - 0
src/Entity/Education/EducationCurriculum.php

@@ -86,6 +86,13 @@ class EducationCurriculum
     {
     {
         $this->educationStudent = new ArrayCollection();
         $this->educationStudent = new ArrayCollection();
         $this->educationTimings = new ArrayCollection();
         $this->educationTimings = new ArrayCollection();
+        $this->educationStudentWish = new ArrayCollection();
+        $this->courses = new ArrayCollection();
+        $this->examens = new ArrayCollection();
+        $this->intangibles = new ArrayCollection();
+        $this->requiredEducationCurriculumPacks = new ArrayCollection();
+        $this->requiredChoicesEducationCurriculumPacks = new ArrayCollection();
+        $this->optionnalEducationCurriculumPacks = new ArrayCollection();
     }
     }
 
 
     public function getId(): ?int
     public function getId(): ?int

+ 6 - 0
src/Entity/Message/AbstractMessage.php

@@ -7,6 +7,7 @@ namespace App\Entity\Message;
 use App\Attribute\OrganizationDefaultValue;
 use App\Attribute\OrganizationDefaultValue;
 use App\Entity\Organization\Organization;
 use App\Entity\Organization\Organization;
 use App\Enum\Message\MessageStatusEnum;
 use App\Enum\Message\MessageStatusEnum;
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 use Doctrine\ORM\Mapping as ORM;
 use Ramsey\Uuid\Doctrine\UuidGenerator;
 use Ramsey\Uuid\Doctrine\UuidGenerator;
@@ -57,6 +58,11 @@ abstract class AbstractMessage
     #[ORM\OneToMany(mappedBy: 'message', targetEntity: ReportMessage::class, cascade: ['persist'], orphanRemoval: true)]
     #[ORM\OneToMany(mappedBy: 'message', targetEntity: ReportMessage::class, cascade: ['persist'], orphanRemoval: true)]
     protected Collection $reportMessage;
     protected Collection $reportMessage;
 
 
+    public function __construct()
+    {
+        $this->reportMessage = new ArrayCollection();
+    }
+
     public function getId(): ?int
     public function getId(): ?int
     {
     {
         return $this->id;
         return $this->id;

+ 2 - 1
src/Entity/Organization/OnlineRegistrationSettings.php

@@ -40,7 +40,7 @@ class OnlineRegistrationSettings
     #[ORM\OneToMany(mappedBy: 'onlineRegistrationSettingsNewEnrolments', targetEntity: OnlineRegistrationOpeningPeriod::class, cascade: ['persist'], orphanRemoval: true)]
     #[ORM\OneToMany(mappedBy: 'onlineRegistrationSettingsNewEnrolments', targetEntity: OnlineRegistrationOpeningPeriod::class, cascade: ['persist'], orphanRemoval: true)]
     private Collection $openingPeriodsNewEnrolments;
     private Collection $openingPeriodsNewEnrolments;
 
 
-    #[ORM\OneToOne(targetEntity: Organization::class, inversedBy: 'onlineRegistrationSettings', cascade: [])]
+    #[ORM\OneToOne(inversedBy: 'onlineRegistrationSettings', targetEntity: Organization::class, cascade: [])]
     protected Organization $organization;
     protected Organization $organization;
 
 
     #[ORM\OneToMany(
     #[ORM\OneToMany(
@@ -59,6 +59,7 @@ class OnlineRegistrationSettings
         $this->introductionFiles = new ArrayCollection();
         $this->introductionFiles = new ArrayCollection();
         $this->introductionFilesNewEnrolments = new ArrayCollection();
         $this->introductionFilesNewEnrolments = new ArrayCollection();
         $this->openingPeriodsNewEnrolments = new ArrayCollection();
         $this->openingPeriodsNewEnrolments = new ArrayCollection();
+        $this->adultStudentDocuments = new ArrayCollection();
     }
     }
 
 
     public function getId(): ?int
     public function getId(): ?int

+ 9 - 0
src/Entity/Organization/Organization.php

@@ -400,6 +400,15 @@ class Organization
         $this->donors = new ArrayCollection();
         $this->donors = new ArrayCollection();
         $this->tags = new ArrayCollection();
         $this->tags = new ArrayCollection();
         $this->rewards = 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
     public function getId(): ?int

+ 1 - 0
src/Entity/Place/PlaceControl.php

@@ -36,6 +36,7 @@ class PlaceControl extends AbstractControl
     public function __construct()
     public function __construct()
     {
     {
         $this->tags = new ArrayCollection();
         $this->tags = new ArrayCollection();
+        parent::__construct();
     }
     }
 
 
     public function getDiscr(): ?string
     public function getDiscr(): ?string

+ 1 - 0
src/Entity/Place/PlaceRepair.php

@@ -41,6 +41,7 @@ class PlaceRepair extends AbstractRepair
     public function __construct()
     public function __construct()
     {
     {
         $this->tags = new ArrayCollection();
         $this->tags = new ArrayCollection();
+        parent::__construct();
     }
     }
 
 
     public function getDiscr(): ?string
     public function getDiscr(): ?string

+ 6 - 0
src/Entity/Product/AbstractProduct.php

@@ -6,6 +6,7 @@ namespace App\Entity\Product;
 
 
 use App\Entity\Core\Tagg;
 use App\Entity\Core\Tagg;
 use App\Entity\Organization\Organization;
 use App\Entity\Organization\Organization;
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 use Doctrine\ORM\Mapping as ORM;
 
 
@@ -26,6 +27,11 @@ abstract class AbstractProduct
     #[ORM\ManyToOne]
     #[ORM\ManyToOne]
     protected Organization $organization;
     protected Organization $organization;
 
 
+    public function __construct()
+    {
+        $this->tags = new ArrayCollection();
+    }
+
     public function getId(): ?int
     public function getId(): ?int
     {
     {
         return $this->id;
         return $this->id;

+ 4 - 0
src/Entity/Product/Equipment.php

@@ -112,6 +112,10 @@ class Equipment extends AbstractProduct
         $this->equipmentLoan = new ArrayCollection();
         $this->equipmentLoan = new ArrayCollection();
         $this->instrumentOrVoice = new ArrayCollection();
         $this->instrumentOrVoice = new ArrayCollection();
         $this->tags = new ArrayCollection();
         $this->tags = new ArrayCollection();
+        $this->equipmentCompositionChildren = new ArrayCollection();
+        $this->equipmentLoanFiltered = new ArrayCollection();
+        $this->examenConvocations = new ArrayCollection();
+        parent::__construct();
     }
     }
 
 
     public function getDiscr(): ?string
     public function getDiscr(): ?string

+ 3 - 0
src/Entity/Product/Intangible.php

@@ -55,6 +55,9 @@ class Intangible extends AbstractProduct
         $this->educationCurriculums = new ArrayCollection();
         $this->educationCurriculums = new ArrayCollection();
         $this->accessIntangibles = new ArrayCollection();
         $this->accessIntangibles = new ArrayCollection();
         $this->tags = new ArrayCollection();
         $this->tags = new ArrayCollection();
+        $this->educationCurriculumPacks = new ArrayCollection();
+        $this->intangiblePriceAndDiscount = new IntangiblePriceAndDiscount();
+        parent::__construct();
     }
     }
 
 
     public function getDiscr(): ?string
     public function getDiscr(): ?string