Use Icinga\Data\Db\DbConnection instead of Zend_Db_Select directly

fixes #6218
This commit is contained in:
Johannes Meyer 2014-07-09 10:41:54 +02:00
parent 329b1cf960
commit 0fc2604af3
1 changed files with 2 additions and 3 deletions

View File

@ -5,7 +5,6 @@
namespace Icinga\User\Preferences\Store;
use Exception;
use Zend_Db_Select;
use Icinga\Exception\NotReadableError;
use Icinga\Exception\NotWritableError;
use Icinga\User\Preferences;
@ -73,10 +72,10 @@ class DbStore extends PreferencesStore
public function load()
{
try {
$select = new Zend_Db_Select($this->getStoreConfig()->connection->getConnection());
$select = $this->getStoreConfig()->connection->select();
$result = $select->from($this->table, array(self::COLUMN_PREFERENCE, self::COLUMN_VALUE))
->where(self::COLUMN_USERNAME . ' = ?', $this->getUser()->getUsername())
->query()->fetchAll();
->fetchAll();
} catch (Exception $e) {
throw new NotReadableError(
'Cannot fetch preferences for user ' . $this->getUser()->getUsername() . ' from database', 0, $e