2016-06-24 11:47:45 +02:00
|
|
|
<?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(
|
2016-06-24 17:00:44 +02:00
|
|
|
array('rsr' => 'imported_rowset_row'),
|
2016-06-24 11:47:45 +02:00
|
|
|
'rsr.row_checksum = r.checksum',
|
2016-06-24 17:00:44 +02:00
|
|
|
array()
|
2016-06-24 11:47:45 +02:00
|
|
|
)->where(
|
|
|
|
'rsr.rowset_checksum = ?',
|
|
|
|
$this->getConnection()->quoteBinary($this->rowset_checksum)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|