diff --git a/Models/Department.php b/Models/Department.php index 39c3d20..fa45dc7 100644 --- a/Models/Department.php +++ b/Models/Department.php @@ -45,7 +45,7 @@ class Department public function getParent() { - return $this->parent; + return $this->parent ?? new NullDepartment(); } public function setParent(int $parent) @@ -65,7 +65,7 @@ class Department public function getUnit() { - return $this->unit; + return $this->unit ?? new NullUnit(); } public function setUnit($unit) diff --git a/Models/Position.php b/Models/Position.php index ffc0145..5883ac6 100644 --- a/Models/Position.php +++ b/Models/Position.php @@ -47,7 +47,7 @@ class Position implements ArrayableInterface, \JsonSerializable public function getParent() { - return $this->parent; + return $this->parent ?? new NullPosition(); } public function setParent(int $parent) @@ -57,7 +57,7 @@ class Position implements ArrayableInterface, \JsonSerializable public function getDepartment() { - return $this->department; + return $this->department ?? new NullDepartment(); } public function setDepartment($department) diff --git a/Models/Unit.php b/Models/Unit.php index c6c63ab..8645416 100644 --- a/Models/Unit.php +++ b/Models/Unit.php @@ -45,7 +45,7 @@ class Unit implements ArrayableInterface, \JsonSerializable public function getParent() { - return $this->parent; + return $this->parent ?? new NullUnit(); } public function setParent(int $parent)