mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 08:44:11 +02:00
Db: add fetchActivityLogChecksumById method
This commit is contained in:
parent
42e87476fb
commit
97b81e08d1
@ -179,6 +179,21 @@ class Db extends DbConnection
|
||||
return $this->db()->fetchRow($sql);
|
||||
}
|
||||
|
||||
public function fetchActivityLogChecksumById($id, $binary = true)
|
||||
{
|
||||
$sql = 'SELECT checksum FROM director_activity_log WHERE id = ' . (int) $id;
|
||||
$result = $this->db()->fetchOne($sql);
|
||||
if (is_resource($result)) {
|
||||
$result = stream_get_contents($result);
|
||||
}
|
||||
|
||||
if ($binary) {
|
||||
return $result;
|
||||
} else {
|
||||
return bin2hex($result);
|
||||
}
|
||||
}
|
||||
|
||||
public function fetchActivityLogEntry($checksum)
|
||||
{
|
||||
if ($this->getDbType() === 'pgsql') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user