From 3ad56d3a98bdece3750e3c25fecd0f1d38d33aff Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 16 Jun 2016 14:19:45 +0200 Subject: [PATCH] DirectorDeploymentLog: allow to fetch config... ...checksum for a specific stage name. Implemented getConfigChecksumForStageName for this. --- library/Director/Objects/DirectorDeploymentLog.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/library/Director/Objects/DirectorDeploymentLog.php b/library/Director/Objects/DirectorDeploymentLog.php index 82eb1e3c..16966d1f 100644 --- a/library/Director/Objects/DirectorDeploymentLog.php +++ b/library/Director/Objects/DirectorDeploymentLog.php @@ -71,6 +71,19 @@ class DirectorDeploymentLog extends DbObject return (int) $db->fetchOne($query) > 0; } + public static function getConfigChecksumForStageName(Db $connection, $stage) + { + $db = $connection->getDbAdapter(); + $query = $db->select() + ->from('director_deployment_log', array('c' => $connection->dbHexFunc('config_checksum'))) + ->where('stage_name = ?') + ->where('stage_collected IS NULL') + ->where('startup_succeeded IS NULL') + ->order('stage_name'); + + return $db->fetchOne($query, $stage); + } + public static function loadLatest(Db $connection) { $db = $connection->getDbAdapter();