IcingaObject: add createByType method
This commit is contained in:
parent
61674546d9
commit
2b46eff08f
|
@ -1371,6 +1371,12 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
||||||
return $class::load($id, $db);
|
return $class::load($id, $db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function existsByType($type, $id, Db $db)
|
||||||
|
{
|
||||||
|
$class = self::classByType($type);
|
||||||
|
return $class::exists($id, $db);
|
||||||
|
}
|
||||||
|
|
||||||
public static function loadAllByType($type, Db $db, $query = null, $keyColumn = 'object_name')
|
public static function loadAllByType($type, Db $db, $query = null, $keyColumn = 'object_name')
|
||||||
{
|
{
|
||||||
$class = self::classByType($type);
|
$class = self::classByType($type);
|
||||||
|
|
Loading…
Reference in New Issue