IcingaObject: add createByType method

This commit is contained in:
Thomas Gelf 2016-03-16 20:27:26 +01:00
parent 61674546d9
commit 2b46eff08f
1 changed files with 6 additions and 0 deletions

View File

@ -1371,6 +1371,12 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
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')
{
$class = self::classByType($type);