mirror of
https://github.com/Karaka-Management/oms-Organization.git
synced 2026-02-04 02:28:41 +00:00
add null objects as return
This commit is contained in:
parent
565fd23916
commit
dbd67c164a
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user