DirectorDeploymentLog: use predefined aliases...

...to avoid problems with too much intelligence in deeper db
abstraction layers
This commit is contained in:
Thomas Gelf 2016-07-21 13:12:45 +02:00
parent dcecba0098
commit 1555d049f2
1 changed files with 6 additions and 4 deletions

View File

@ -75,8 +75,10 @@ class DirectorDeploymentLog extends DbObject
{
$db = $connection->getDbAdapter();
$query = $db->select()
->from('director_deployment_log', array('c' => $connection->dbHexFunc('config_checksum')))
->where('stage_name = ?');
->from(
array('l' => 'director_deployment_log'),
array('c' => $connection->dbHexFunc('l.config_checksum'))
)->where('l.stage_name = ?');
return $db->fetchOne($query, $stage);
}
@ -85,8 +87,8 @@ class DirectorDeploymentLog extends DbObject
{
$db = $connection->getDbAdapter();
$query = $db->select()->from(
'director_deployment_log',
array('id' => 'MAX(id)')
array('l' => 'director_deployment_log'),
array('id' => 'MAX(l.id)')
);
return static::load($db->fetchOne($query), $connection);