Merge branch 'ent-6536-servicios-item-tipo-agente-desconocido-en-mapa-de-servicio' into 'develop'

Ent 6536 servicios item tipo agente desconocido en mapa de servicio

See merge request artica/pandorafms!3574
This commit is contained in:
Daniel Rodriguez 2020-11-30 14:29:43 +01:00
commit 64509df179

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 $force Force recalculation.
*
* @return integer Status of the agent. * @return integer Status of the agent.
*/ */
public function lastStatus() public function lastStatus(bool $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()
); );
} }