From f92689efd7b43e5b2ac206ba2527b91503081d6c Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sat, 29 Aug 2015 01:05:23 +0200 Subject: [PATCH] Db: implement getUncollectedDeployments() --- library/Director/Db.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/library/Director/Db.php b/library/Director/Db.php index cda1737e..41c8c3a9 100644 --- a/library/Director/Db.php +++ b/library/Director/Db.php @@ -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'); + } }