mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
Changes in disabled method - Module class
This commit is contained in:
parent
70b8eb77a3
commit
f003c37b09
@ -316,6 +316,30 @@ class Module extends Entity
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get/set for disable field, this method also takes in mind the status of
|
||||||
|
* assigned agent (if any).
|
||||||
|
*
|
||||||
|
* @param boolean|null $disabled Used in set operations.
|
||||||
|
*
|
||||||
|
* @return boolean|null Return disabled status for this module or null if
|
||||||
|
* set operation.
|
||||||
|
*/
|
||||||
|
public function disabled(?bool $disabled=null)
|
||||||
|
{
|
||||||
|
if ($disabled === null) {
|
||||||
|
if ($this->agent() !== null) {
|
||||||
|
return ((bool) $this->fields['disabled'] || (bool) $this->agent()->disabled());
|
||||||
|
}
|
||||||
|
|
||||||
|
return ((bool) $this->fields['disabled']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->fields['disabled'] = $disabled;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dynamically call methods in this object.
|
* Dynamically call methods in this object.
|
||||||
*
|
*
|
||||||
@ -394,9 +418,7 @@ class Module extends Entity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new \Exception(
|
return parent::__call($methodName, $params);
|
||||||
get_class($this).' error, method '.$methodName.' does not exist'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user