Db: implement getUncollectedDeployments()

This commit is contained in:
Thomas Gelf 2015-08-29 01:05:23 +02:00
parent c0043c26b0
commit f92689efd7
1 changed files with 14 additions and 0 deletions

View File

@ -3,6 +3,7 @@
namespace Icinga\Module\Director;
use Icinga\Data\Db\DbConnection;
use Icinga\Module\Director\Objects\DirectorDeploymentLog;
use Zend_Db_Expr;
class Db extends DbConnection
@ -380,4 +381,17 @@ class Db extends DbConnection
$filters = array('object_type = ?' => 'template') + $filters;
return $this->enum('icinga_' . $type, null, $filters);
}
public function getUncollectedDeployments()
{
$db = $this->db();
$query = $db->select()
->from('director_deployment_log')
->where('stage_name IS NOT NULL')
->where('stage_collected IS NULL')
->order('stage_name');
return DirectorDeploymentLog::loadAll($this, $query, 'stage_name');
}
}