Db: cosmetics

This commit is contained in:
Thomas Gelf 2016-12-16 12:23:47 +01:00
parent ec0cbac657
commit 8687ecaeeb
1 changed files with 2 additions and 4 deletions

View File

@ -2,12 +2,10 @@
namespace Icinga\Module\Director; namespace Icinga\Module\Director;
use Icinga\Exception\IcingaException;
use Icinga\Module\Director\Data\Db\DbConnection; use Icinga\Module\Director\Data\Db\DbConnection;
use Icinga\Module\Director\Objects\DirectorDeploymentLog; use Icinga\Module\Director\Objects\DirectorDeploymentLog;
use Icinga\Module\Director\Objects\IcingaEndpoint; use Icinga\Module\Director\Objects\IcingaEndpoint;
use Icinga\Module\Director\Objects\IcingaObject; use Icinga\Module\Director\Objects\IcingaObject;
use Icinga\Module\Director\Util;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;
use Zend_Db_Expr; use Zend_Db_Expr;
use Zend_Db_Select; use Zend_Db_Select;
@ -43,7 +41,7 @@ class Db extends DbConnection
if ($object !== null) { if ($object !== null) {
$query .= $db->quoteInto(' AND object_type = ?', $object->getTableName()); $query .= $db->quoteInto(' AND object_type = ?', $object->getTableName());
$query .= $db->quoteInto(' AND object_name = ?', $object->object_name); $query .= $db->quoteInto(' AND object_name = ?', $object->getObjectName());
} }
return (int) $db->fetchOne($query); return (int) $db->fetchOne($query);
} }
@ -224,7 +222,7 @@ class Db extends DbConnection
public function fetchActivityLogChecksumById($id, $binary = true) public function fetchActivityLogChecksumById($id, $binary = true)
{ {
$sql = sprintf( $sql = sprintf(
'SELECT %s AS checksum FROM director_activity_log WHERE id = %d', 'SELECT' . ' %s AS checksum FROM director_activity_log WHERE id = %d',
$this->dbHexFunc('checksum'), $this->dbHexFunc('checksum'),
(int) $id (int) $id
); );