Skip to content

Commit 9085a7d

Browse files
committed
relation
1 parent 9c6f805 commit 9085a7d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/Models/Traits/RelateToSpace.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44

55
trait RelateToSpace {
66
protected ?string $space_key;
7-
public function getSpaceKey():string{
7+
public function getSpaceKey (): ?string {
88
return $this->space_key;
99
}
10-
public function setSpaceKey($key){
10+
11+
public function setSpaceKey ( $key ) {
1112
$this->space_key = $key;
1213
}
1314

1415
public function relation($parent=null):void{
1516
parent::relation($parent);
1617
$this->space_key = null;
17-
$this->space_key = $this->spaceKey ?? $parent->space_key ?? $parent?->spaceKey ?? null;
18+
$this->space_key = $this->spaceKey ?? $parent?->getSpaceKey() ?? $parent?->spaceKey ?? null;
1819
}
1920
}

0 commit comments

Comments
 (0)