mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-25 23:04:53 +02:00
ImportRun: provide historic run as a standalone...
...object
This commit is contained in:
parent
3f883ed98b
commit
9ae70a4377
39
library/Director/Objects/ImportRun.php
Normal file
39
library/Director/Objects/ImportRun.php
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Icinga\Module\Director\Objects;
|
||||||
|
|
||||||
|
use Icinga\Module\Director\Data\Db\DbObject;
|
||||||
|
|
||||||
|
class ImportRun extends DbObject
|
||||||
|
{
|
||||||
|
protected $table = 'import_run';
|
||||||
|
|
||||||
|
protected $keyName = 'id';
|
||||||
|
|
||||||
|
protected $autoincKeyName = 'id';
|
||||||
|
|
||||||
|
protected $defaultProperties = array(
|
||||||
|
'id' => null,
|
||||||
|
'source_id' => null,
|
||||||
|
'rowset_checksum' => null,
|
||||||
|
'start_time' => null,
|
||||||
|
'end_time' => null,
|
||||||
|
// TODO: Check whether succeeded could be dropped
|
||||||
|
'succeeded' => null,
|
||||||
|
);
|
||||||
|
|
||||||
|
public function prepareImportedObjectQuery($columns = array('object_name'))
|
||||||
|
{
|
||||||
|
return $this->getDb()->select()->from(
|
||||||
|
array('r' => 'imported_row'),
|
||||||
|
$columns
|
||||||
|
)->joinLeft(
|
||||||
|
array('rsr' => 'rowset_checksum'),
|
||||||
|
'rsr.row_checksum = r.checksum',
|
||||||
|
'r.object_name'
|
||||||
|
)->where(
|
||||||
|
'rsr.rowset_checksum = ?',
|
||||||
|
$this->getConnection()->quoteBinary($this->rowset_checksum)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user