From: Michael J. Rubinsky Date: Wed, 19 May 2010 18:31:47 +0000 (-0400) Subject: use getTable() and getReadDb() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=24f67a17f714731fdf16698480c9fe0550123527;p=horde.git use getTable() and getReadDb() --- diff --git a/ansel/lib/Storage.php b/ansel/lib/Storage.php index d4355c14a..f1b85f16f 100644 --- a/ansel/lib/Storage.php +++ b/ansel/lib/Storage.php @@ -257,7 +257,7 @@ class Ansel_Storage } $stmt = $this->_db->prepare('SELECT share_id FROM ' - . $this->_shares->_table . ' WHERE attribute_slug = ?'); + . $this->_shares->getTable() . ' WHERE attribute_slug = ?'); if ($stmt instanceof PEAR_Error) { Horde::logMessage($stmt, 'ERR'); @@ -356,10 +356,10 @@ class Ansel_Storage */ public function getGalleriesBySlugs($slugs) { - $sql = 'SELECT share_id FROM ' . $this->_shares->_table + $sql = 'SELECT share_id FROM ' . $this->_shares->getTable() . ' WHERE attribute_slug IN (' . str_repeat('?, ', count($slugs) - 1) . '?)'; - $stmt = $this->_shares->_db->prepare($sql); + $stmt = $this->_shares->getReadDb->prepare($sql); if ($stmt instanceof PEAR_Error) { throw new Horde_Exception($stmt->getMessage()); } @@ -728,8 +728,8 @@ class Ansel_Storage } elseif (count($slugs)) { // Searching by gallery_slug so we need to join the share table $sql = 'SELECT ' . $this->_getImageFields() . ' FROM ansel_images LEFT JOIN ' - . $this->_shares->_table . ' ON ansel_images.gallery_id = ' - . $this->_shares->_table . '.share_id ' . 'WHERE attribute_slug IN (' + . $this->_shares->getTable() . ' ON ansel_images.gallery_id = ' + . $this->_shares->getTable() . '.share_id ' . 'WHERE attribute_slug IN (' . str_repeat('?, ', count($slugs) - 1) . '?) '; } else { return array(); @@ -779,7 +779,7 @@ class Ansel_Storage { if (empty($slug)) { $results = $this->_db->queryOne( - 'SELECT COUNT(share_id) FROM ' . $this->_shares->_table + 'SELECT COUNT(share_id) FROM ' . $this->_shares->getTable() . ' WHERE share_id = ' . (int)$gallery_id); if ($results instanceof PEAR_Error) { throw new Ansel_Exception($results);