mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 08:14:04 +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)
|
||||
{
|
||||
// allow for icinga_host and host
|
||||
$type = preg_replace('/^icinga_/', '', $type);
|
||||
|
||||
if (strpos($type, 'data') === false) {
|
||||
$prefix = 'Icinga';
|
||||
} else {
|
||||
$prefix = 'Director';
|
||||
}
|
||||
|
||||
return 'Icinga\\Module\\Director\\Objects\\' . $prefix . ucfirst($type);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user