Added -force- option to Agent::lastStatus

This commit is contained in:
fbsanchez 2020-10-26 17:12:27 +01:00
parent 76324679ec
commit 633116a793

View File

@ -104,13 +104,22 @@ class Agent extends Entity
/** /**
* Return last value (status) of the agent. * Return last value (status) of the agent.
* *
* @param boolean $recalc Forcre recalculation.
*
* @return integer Status of the agent. * @return integer Status of the agent.
*/ */
public function lastStatus() public function lastStatus($force=false)
{ {
if ($force === true) {
return \agents_get_status(
$this->id_agente()
);
}
return \agents_get_status_from_counts( return \agents_get_status_from_counts(
$this->toArray() $this->toArray()
); );
} }