mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
IcingaConfig: allow to loadByActivityChecksum
This commit is contained in:
parent
0199af7dcb
commit
c205d9f80d
@ -132,6 +132,24 @@ class IcingaConfig
|
|||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function loadByActivityChecksum($checksum, Db $connection)
|
||||||
|
{
|
||||||
|
$db = $connection->getDbAdapter();
|
||||||
|
$query = $db->select()->from(
|
||||||
|
array('c' => self::$table),
|
||||||
|
array('checksum' => 'c.checksum')
|
||||||
|
)->join(
|
||||||
|
array('l' => 'director_activity_log'),
|
||||||
|
'l.checksum = c.last_activity_checksum',
|
||||||
|
array()
|
||||||
|
)->where(
|
||||||
|
'last_activity_checksum = ?',
|
||||||
|
$connection->quoteBinary(Util::hex2binary($checksum))
|
||||||
|
)->order('l.id DESC')->limit(1);
|
||||||
|
|
||||||
|
return self::load($db->fetchOne($query), $connection);
|
||||||
|
}
|
||||||
|
|
||||||
public static function generate(Db $connection)
|
public static function generate(Db $connection)
|
||||||
{
|
{
|
||||||
$config = new static($connection);
|
$config = new static($connection);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user