mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
IcingaObject: allow to load by type with prefix
This commit is contained in:
parent
dd06be4a58
commit
4d34b2188e
@ -718,11 +718,15 @@ return '';
|
|||||||
|
|
||||||
protected static function classByType($type)
|
protected static function classByType($type)
|
||||||
{
|
{
|
||||||
|
// allow for icinga_host and host
|
||||||
|
$type = preg_replace('/^icinga_/', '', $type);
|
||||||
|
|
||||||
if (strpos($type, 'data') === false) {
|
if (strpos($type, 'data') === false) {
|
||||||
$prefix = 'Icinga';
|
$prefix = 'Icinga';
|
||||||
} else {
|
} else {
|
||||||
$prefix = 'Director';
|
$prefix = 'Director';
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'Icinga\\Module\\Director\\Objects\\' . $prefix . ucfirst($type);
|
return 'Icinga\\Module\\Director\\Objects\\' . $prefix . ucfirst($type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user