Add missing const to parent() and children() relations

This commit is contained in:
Deon George 2023-12-01 17:25:01 +11:00
parent 535a082edd
commit 5b7ec1a629

View File

@ -193,10 +193,12 @@ class Address extends Model
break;
case self::NODE_UNKNOWN:
case self::NODE_ACTIVE:
case self::NODE_POINT:
case self::NODE_PVT:
case self::NODE_HOLD:
case self::NODE_DOWN:
case self::NODE_POINT:
case self::NODE_UNKNOWN:
// Nodes dont have children, but must return a relationship instance
return $this->hasOne(self::class,NULL,'void');
@ -344,6 +346,9 @@ class Address extends Model
case self::NODE_HC:
// Normal Nodes
case self::NODE_ACTIVE:
case self::NODE_PVT:
case self::NODE_HOLD:
case self::NODE_DOWN:
// If we are a child of a hub, then check our hub
$parent = ($this->hub_id
? self::where('id',$this->hub_id)
@ -358,7 +363,6 @@ class Address extends Model
case self::NODE_UNKNOWN:
case self::NODE_POINT:
case self::NODE_DOWN:
// @todo Points - if the boss is defined, we should return it.
return NULL;