mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
minor fix
This commit is contained in:
parent
dbf1265fd0
commit
c8d86a4bdb
@ -413,11 +413,12 @@ class Agent extends Entity
|
|||||||
/**
|
/**
|
||||||
* Search for modules into this agent.
|
* Search for modules into this agent.
|
||||||
*
|
*
|
||||||
* @param array $filter Filters.
|
* @param array $filter Filters.
|
||||||
|
* @param integer $limit Limit search results.
|
||||||
*
|
*
|
||||||
* @return PandoraFMS\Module Module found.
|
* @return PandoraFMS\Module Module found.
|
||||||
*/
|
*/
|
||||||
public function searchModules(array $filter)
|
public function searchModules(array $filter, int $limit=0)
|
||||||
{
|
{
|
||||||
$filter['id_agente'] = $this->id_agente();
|
$filter['id_agente'] = $this->id_agente();
|
||||||
|
|
||||||
@ -428,7 +429,7 @@ class Agent extends Entity
|
|||||||
foreach ($this->modules as $module) {
|
foreach ($this->modules as $module) {
|
||||||
$found = true;
|
$found = true;
|
||||||
foreach ($filter as $field => $value) {
|
foreach ($filter as $field => $value) {
|
||||||
if ($module->{$field}() !== $value) {
|
if ($module->{$field}() != $value) {
|
||||||
$found = false;
|
$found = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -442,7 +443,7 @@ class Agent extends Entity
|
|||||||
return $results;
|
return $results;
|
||||||
} else {
|
} else {
|
||||||
// Search in db.
|
// Search in db.
|
||||||
return Module::search($filter);
|
return Module::search($filter, $limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user