We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9085a7d commit 93a595bCopy full SHA for 93a595b
src/lib/Models/Traits/RelateToSpace.php
@@ -4,6 +4,7 @@
4
5
trait RelateToSpace {
6
protected ?string $space_key;
7
+
8
public function getSpaceKey (): ?string {
9
return $this->space_key;
10
}
@@ -12,9 +13,12 @@ public function setSpaceKey ( $key ) {
12
13
$this->space_key = $key;
14
15
- public function relation($parent=null):void{
16
- parent::relation($parent);
+ public function relation ( $parent = null ): void {
17
+ parent::relation( $parent );
18
$this->space_key = null;
- $this->space_key = $this->spaceKey ?? $parent?->getSpaceKey() ?? $parent?->spaceKey ?? null;
19
+ $this->space_key = $parent?->spaceKey ?? null;
20
+ if ( $parent && method_exists( $parent, 'getSpaceKey' ) ) {
21
+ $this->space_key = $parent->getSpaceKey() ?? null;
22
+ }
23
24
0 commit comments