|
|
@@ -160,9 +160,8 @@ class Parameters
|
|
|
#[ORM\Column(options: ['default' => false])]
|
|
|
private bool $sendAttendanceSms = false;
|
|
|
|
|
|
- #[ORM\OneToOne( mappedBy: 'parameters', targetEntity: Subdomain::class)]
|
|
|
- #[ApiSubresource]
|
|
|
- private Subdomain $activeSubdomain;
|
|
|
+ #[ORM\OneToOne(targetEntity: Subdomain::class, cascade: ['persist'], fetch: 'EAGER')]
|
|
|
+ private ?Subdomain $activeSubdomain = null;
|
|
|
|
|
|
#[ORM\OneToMany( mappedBy: 'parameters', targetEntity: Subdomain::class)]
|
|
|
#[ApiSubresource]
|
|
|
@@ -635,4 +634,35 @@ class Parameters
|
|
|
|
|
|
return $this;
|
|
|
}
|
|
|
+
|
|
|
+ public function getActiveSubdomain(): ?Subdomain
|
|
|
+ {
|
|
|
+ return $this->activeSubdomain;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function setActiveSubdomain(?Subdomain $activeSubdomain): self
|
|
|
+ {
|
|
|
+ $this->activeSubdomain = $activeSubdomain;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getSubdomains(): Collection
|
|
|
+ {
|
|
|
+ return $this->subdomains;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function addSubdomain($subdomain): self
|
|
|
+ {
|
|
|
+ $subdomain->setParameters($this);
|
|
|
+ $this->subdomains[] = $subdomain;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function removeSubdomain($subdomain): self
|
|
|
+ {
|
|
|
+ $subdomain->setParameters(null);
|
|
|
+ $this->subdomains->removeElement($subdomain);
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
}
|