Forráskód Böngészése

delete subresource

Vincent 2 éve
szülő
commit
354309649d

+ 2 - 3
src/Entity/Access/Access.php

@@ -37,7 +37,6 @@ use App\Entity\Product\EquipmentLoan;
 use App\Filter\Person\FullNameFilter;
 use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
 use ApiPlatform\Core\Annotation\ApiResource;
-use ApiPlatform\Core\Annotation\ApiSubresource;
 use App\Entity\Billing\AccessIntangible;
 use App\Entity\Billing\AccessPayer;
 use App\Entity\Core\Notification;
@@ -112,11 +111,11 @@ class Access implements UserInterface, PasswordAuthenticatedUserInterface
     private AccessBilling $accessBilling;
 
     #[ORM\OneToMany(mappedBy: 'access', targetEntity: PersonActivity::class, cascade: ['persist'], orphanRemoval: true)]
-    #[ApiSubresource]
+    #[ApiResource]
     private Collection $personActivity;
 
     #[ORM\OneToMany(mappedBy: 'access', targetEntity: OrganizationFunction::class, cascade: ['persist'], orphanRemoval: true)]
-    #[ApiSubresource]
+    #[ApiResource]
     private Collection $organizationFunction;
 
     #[ORM\OneToMany(mappedBy: 'licensee', targetEntity: OrganizationLicence::class, cascade: ['persist'], orphanRemoval: true)]

+ 0 - 1
src/Entity/Billing/BillingSetting.php

@@ -4,7 +4,6 @@ declare(strict_types=1);
 namespace App\Entity\Billing;
 
 use ApiPlatform\Core\Annotation\ApiResource;
-use ApiPlatform\Core\Annotation\ApiSubresource;
 use App\Entity\Organization\Organization;
 use App\Repository\Billing\BillingSettingRepository;
 use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;

+ 1 - 1
src/Entity/Message/ReportSms.php

@@ -19,7 +19,7 @@ class ReportSms extends AbstractReport
     #[ORM\GeneratedValue]
     private ?int $id = null;
 
-    #[ORM\ManyToOne(inversedBy: 'reports')]
+    #[ORM\ManyToOne(targetEntity: Sms::class ,inversedBy: 'reports')]
     #[ORM\JoinColumn('message_id')]
     private Sms $sms;
 

+ 7 - 7
src/Entity/Message/Sms.php

@@ -30,7 +30,7 @@ class Sms extends AbstractMessage
     private Access $author;
 
     #[ORM\OneToMany(mappedBy: 'sms', targetEntity: ReportSms::class, cascade: ['persist'], orphanRemoval: true)]
-    private Collection $report;
+    private Collection $reports;
 
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'sms', cascade: ['persist'])]
     #[ORM\JoinTable(name: 'tag_message')]
@@ -41,7 +41,7 @@ class Sms extends AbstractMessage
     public function __construct()
     {
         $this->uuid = Uuid::uuid4();
-        $this->report = new ArrayCollection();
+        $this->reports = new ArrayCollection();
         $this->tags = new ArrayCollection();
     }
 
@@ -72,15 +72,15 @@ class Sms extends AbstractMessage
     /**
      * @return Collection<int, ReportSms>
      */
-    public function getReport(): Collection
+    public function getReports(): Collection
     {
-        return $this->report;
+        return $this->reports;
     }
 
     public function addReport(ReportSms $report): self
     {
-        if (!$this->report->contains($report)) {
-            $this->report[] = $report;
+        if (!$this->reports->contains($report)) {
+            $this->reports[] = $report;
             $report->setSms($this);
         }
 
@@ -89,7 +89,7 @@ class Sms extends AbstractMessage
 
     public function removeReport(ReportSms $report): self
     {
-        if ($this->report->removeElement($report)) {
+        if ($this->reports->removeElement($report)) {
             // set the owning side to null (unless already changed)
             if ($report->getSms() === $this) {
                 $report->setSms(null);

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

@@ -4,7 +4,6 @@ declare(strict_types=1);
 namespace App\Entity\Organization;
 
 use ApiPlatform\Core\Annotation\ApiResource;
-use ApiPlatform\Core\Annotation\ApiSubresource;
 use App\Entity\Access\Access;
 use App\Entity\Billing\BillingSetting;
 use App\Entity\Booking\Attendance;
@@ -84,7 +83,7 @@ class Organization
     private Collection $accesses;
 
     #[ORM\OneToMany(mappedBy: 'organization', targetEntity: NetworkOrganization::class, orphanRemoval: true)]
-    #[ApiSubresource]
+    #[ApiResource]
     private Collection $networkOrganizations;
 
     #[ORM\OneToMany(mappedBy: 'parent', targetEntity: NetworkOrganization::class, orphanRemoval: true)]
@@ -98,7 +97,7 @@ class Organization
     private Parameters $parameters;
 
     #[ORM\OneToOne(mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
-    #[ApiSubresource]
+    #[ApiResource]
     private BillingSetting $billingSetting;
 
     #[ORM\Column(type: 'text', nullable: true)]
@@ -217,31 +216,31 @@ class Organization
     private ?File $image = null;
 
     #[ORM\ManyToMany(targetEntity: TypeOfPractice::class, mappedBy: 'organizations')]
-    #[ApiSubresource]
+    #[ApiResource]
     private Collection $typeOfPractices;
 
     #[ORM\Column(nullable: true)]
     private ?string $otherPractice = null;
 
     #[ORM\ManyToMany(targetEntity: ContactPoint::class, mappedBy: 'organization')]
-    #[ApiSubresource]
+    #[ApiResource]
     private Collection $contactPoints;
 
     #[ORM\ManyToMany(targetEntity: BankAccount::class, inversedBy: 'organization')]
     #[ORM\JoinColumn(name: 'organization_id', referencedColumnName: 'id', unique: true)]
     #[ORM\InverseJoinColumn(name: 'bankAccount_id', referencedColumnName: 'id')]
-    #[ApiSubresource]
+    #[ApiResource]
     private Collection $bankAccounts;
 
     #[ORM\OneToMany( mappedBy: 'organization', targetEntity: OrganizationAddressPostal::class, orphanRemoval: true)]
-    #[ApiSubresource]
+    #[ApiResource]
     private Collection $organizationAddressPostals;
 
     #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationLicence::class, orphanRemoval: true)]
     private Collection $organizationLicences;
 
     #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationArticle::class, orphanRemoval: true)]
-    #[ApiSubresource]
+    #[ApiResource]
     private Collection $organizationArticles;
 
     #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Cycle::class, orphanRemoval: true)]
@@ -251,7 +250,7 @@ class Organization
     private Collection $educationTimings;
 
     #[ORM\OneToMany( mappedBy: 'organization', targetEntity: Subdomain::class)]
-    #[ApiSubresource]
+    #[ApiResource]
     private Collection $subdomains;
 
     #[ORM\ManyToOne(inversedBy: 'organizationContacts')]

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

@@ -5,7 +5,6 @@ declare(strict_types=1);
 namespace App\Entity\Organization;
 
 use ApiPlatform\Core\Annotation\ApiResource;
-use ApiPlatform\Core\Annotation\ApiSubresource;
 use App\Entity\Access\Access;
 use App\Entity\Core\File;
 use App\Repository\Organization\ParametersRepository;
@@ -87,7 +86,7 @@ class Parameters
     private bool $desactivateOpentalentSiteWeb = false;
 
     #[ORM\OneToMany( mappedBy: 'publicationDirector', targetEntity: Access::class)]
-    #[ApiSubresource]
+    #[ApiResource]
     private Collection $publicationDirectors;
 
     #[ORM\Column(length: 255, nullable: true)]