From 797e3ac0ebf92d28f53f5892a6e54ae0d194742b Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 17 Jan 2011 14:15:40 -0500 Subject: [PATCH] Add Horde_Share_Sql_Hierarchical::_exists() --- framework/Share/lib/Horde/Share/Sql/Hierarchical.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/framework/Share/lib/Horde/Share/Sql/Hierarchical.php b/framework/Share/lib/Horde/Share/Sql/Hierarchical.php index b83926b45..eb39e9304 100644 --- a/framework/Share/lib/Horde/Share/Sql/Hierarchical.php +++ b/framework/Share/lib/Horde/Share/Sql/Hierarchical.php @@ -450,4 +450,21 @@ class Horde_Share_Sql_Hierarchical extends Horde_Share_Sql return $this->_db->selectValue($query); } + /** + * Checks if a share exists in the system. + * + * @param string $share The share to check. + * + * @return boolean True if the share exists. + * @throws Horde_Share_Exception + */ + protected function _exists($share) + { + try { + return (boolean)$this->_db->selectOne('SELECT 1 FROM ' . $this->_table . ' WHERE share_id = ?', array($share)); + } catch (Horde_Db_Exception $e) { + throw new Horde_Share_Exception($e); + } + } + } -- 2.11.0