mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-06-08 16:22:05 -04:00
ObjectSuggestions: Add methods to restrict $customVarSources
This commit is contained in:
parent
b52c219881
commit
481dac43f9
1 changed files with 14 additions and 0 deletions
|
|
@ -419,4 +419,18 @@ class ObjectSuggestions extends Suggestions
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduce {@see $customVarSources} to only given relations to fetch variables from
|
||||
*
|
||||
* @param string[] $relations
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function onlyWithCustomVarSources(array $relations): self
|
||||
{
|
||||
$this->customVarSources = array_intersect_key($this->customVarSources, array_flip($relations));
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue