|
|
@@ -5,6 +5,7 @@ namespace App\Entity\Organization;
|
|
|
|
|
|
use ApiPlatform\Core\Annotation\ApiResource;
|
|
|
use ApiPlatform\Core\Annotation\ApiSubresource;
|
|
|
+use App\Entity\Billing\BillingSetting;
|
|
|
use App\Entity\Core\BankAccount;
|
|
|
use App\Entity\Core\ContactPoint;
|
|
|
use App\Entity\Core\File;
|
|
|
@@ -37,7 +38,7 @@ class Organization
|
|
|
#[ORM\GeneratedValue]
|
|
|
private ?int $id = null;
|
|
|
|
|
|
- #[ORM\Column(length: 128)]
|
|
|
+ #[ORM\Column(length: 128, nullable: false)]
|
|
|
public string $name;
|
|
|
|
|
|
#[ORM\Column(length: 128)]
|
|
|
@@ -55,6 +56,7 @@ class Organization
|
|
|
private Settings $settings;
|
|
|
|
|
|
#[ORM\OneToMany(mappedBy: 'organization', targetEntity: NetworkOrganization::class, orphanRemoval: true)]
|
|
|
+ #[ApiSubresource]
|
|
|
private Collection $networkOrganizations;
|
|
|
|
|
|
#[ORM\OneToMany(mappedBy: 'parent', targetEntity: NetworkOrganization::class, orphanRemoval: true)]
|
|
|
@@ -64,8 +66,8 @@ class Organization
|
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
|
private Parameters $parameters;
|
|
|
|
|
|
- #[ORM\OneToOne(cascade: ['persist', 'remove'])]
|
|
|
- private File $logo;
|
|
|
+ #[ORM\OneToOne(mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
|
|
+ private BillingSetting $billingSetting;
|
|
|
|
|
|
#[ORM\Column(length: 255, nullable: true)]
|
|
|
private ?string $description = null;
|
|
|
@@ -100,6 +102,9 @@ class Organization
|
|
|
#[ORM\Column(length: 255, nullable: true)]
|
|
|
private ?string $twitter = null;
|
|
|
|
|
|
+ #[ORM\Column(length: 255, nullable: true)]
|
|
|
+ private ?string $youtube = null;
|
|
|
+
|
|
|
#[ORM\Column(length: 255, nullable: true)]
|
|
|
private ?string $instagram = null;
|
|
|
|
|
|
@@ -168,6 +173,18 @@ class Organization
|
|
|
#[ORM\Column(nullable: true)]
|
|
|
private ?int $cmsId = null;
|
|
|
|
|
|
+ #[ORM\ManyToOne(inversedBy: 'organizationLogos')]
|
|
|
+ #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
|
|
|
+ private ?File $logo = null;
|
|
|
+
|
|
|
+ #[ORM\ManyToOne(inversedBy: 'organizationLogos')]
|
|
|
+ #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
|
|
|
+ private ?File $image = null;
|
|
|
+
|
|
|
+ #[ORM\ManyToMany(targetEntity: TypeOfPractice::class, mappedBy: 'organizations')]
|
|
|
+ #[ApiSubresource]
|
|
|
+ private Collection $typeOfPractices;
|
|
|
+
|
|
|
#[ORM\Column(nullable: true)]
|
|
|
private ?string $otherPractice = null;
|
|
|
|
|
|
@@ -186,14 +203,20 @@ class Organization
|
|
|
#[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationLicence::class, orphanRemoval: true)]
|
|
|
private Collection $organizationLicences;
|
|
|
|
|
|
+ #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationArticle::class, orphanRemoval: true)]
|
|
|
+ #[ApiSubresource]
|
|
|
+ private Collection $organizationArticles;
|
|
|
+
|
|
|
#[Pure] public function __construct()
|
|
|
{
|
|
|
$this->networkOrganizations = new ArrayCollection();
|
|
|
$this->networkOrganizationChildren = new ArrayCollection();
|
|
|
+ $this->typeOfPractices = new ArrayCollection();
|
|
|
$this->contactPoints = new ArrayCollection();
|
|
|
$this->bankAccounts = new ArrayCollection();
|
|
|
$this->organizationAddressPostals = new ArrayCollection();
|
|
|
$this->organizationLicences = new ArrayCollection();
|
|
|
+ $this->organizationArticles = new ArrayCollection();
|
|
|
}
|
|
|
|
|
|
public function getId(): ?int
|
|
|
@@ -348,6 +371,18 @@ class Organization
|
|
|
$this->logo = $logo;
|
|
|
}
|
|
|
|
|
|
+ public function getBillingSetting(): BillingSetting
|
|
|
+ {
|
|
|
+ return $this->billingSetting;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function setBillingSetting(BillingSetting $billingSetting): self
|
|
|
+ {
|
|
|
+ $this->billingSetting = $billingSetting;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
public function getDescription(): ?string
|
|
|
{
|
|
|
return $this->description;
|
|
|
@@ -480,6 +515,18 @@ class Organization
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
+ public function getYoutube(): ?string
|
|
|
+ {
|
|
|
+ return $this->youtube;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function setYoutube(?string $youtube): self
|
|
|
+ {
|
|
|
+ $this->youtube = $youtube;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
public function getInstagram(): ?string
|
|
|
{
|
|
|
return $this->instagram;
|
|
|
@@ -732,6 +779,41 @@ class Organization
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
+ public function setImage(?File $image):self
|
|
|
+ {
|
|
|
+ $this->image = $image;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getImage(): ?File
|
|
|
+ {
|
|
|
+ return $this->image;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getTypeOfPractices(): Collection
|
|
|
+ {
|
|
|
+ return $this->typeOfPractices;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function addTypeOfPractice(TypeOfPractice $typeOfPractice): self
|
|
|
+ {
|
|
|
+ if (!$this->typeOfPractices->contains($typeOfPractice)) {
|
|
|
+ $this->typeOfPractices[] = $typeOfPractice;
|
|
|
+ $typeOfPractice->addOrganization($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function removeTypeOfPractice(TypeOfPractice $typeOfPractice): self
|
|
|
+ {
|
|
|
+ if ($this->typeOfPractices->removeElement($typeOfPractice)) {
|
|
|
+ $typeOfPractice->removeOrganization($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
public function getOtherPractice(): ?string
|
|
|
{
|
|
|
return $this->otherPractice;
|
|
|
@@ -845,4 +927,31 @@ class Organization
|
|
|
|
|
|
return $this;
|
|
|
}
|
|
|
+
|
|
|
+ public function getOrganizationArticles(): Collection
|
|
|
+ {
|
|
|
+ return $this->organizationArticles;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function addOrganizationArticle(OrganizationArticle $organizationArticle): self
|
|
|
+ {
|
|
|
+ if (!$this->organizationArticles->contains($organizationArticle)) {
|
|
|
+ $this->organizationArticles[] = $organizationArticle;
|
|
|
+ $organizationArticle->setOrganization($this);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function removeOrganizationArticle(OrganizationArticle $organizationArticle): self
|
|
|
+ {
|
|
|
+ if ($this->organizationArticles->removeElement($organizationArticle)) {
|
|
|
+ // set the owning side to null (unless already changed)
|
|
|
+ if ($organizationArticle->getOrganization() === $this) {
|
|
|
+ $organizationArticle->setOrganization(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
}
|