From 7435ec302ec85a011f637fc2fce908f649e3d164 Mon Sep 17 00:00:00 2001 From: zYne Date: Tue, 18 Sep 2007 17:09:14 +0000 Subject: [PATCH] --- lib/Doctrine/Record.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index 3cc1b146c..c109c34ff 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -1399,12 +1399,31 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count * @param array $params prepared statement params (if any) * @return mixed the fetched data */ - public function fetch($queryKey, $params = array()) + public function fetch($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD) { return Doctrine_Manager::getInstance() ->getQueryRegistry() ->get($queryKey, $this->_table->getComponentName()) - ->execute($params); + ->execute($params, $hydrationMode); + } + /** + * fetchOne + * fetches data using the provided queryKey and + * the associated query in the query registry + * + * if no query for given queryKey is being found a + * Doctrine_Query_Registry exception is being thrown + * + * @param string $queryKey the query key + * @param array $params prepared statement params (if any) + * @return mixed the fetched data + */ + public function fetchOne($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD) + { + return Doctrine_Manager::getInstance() + ->getQueryRegistry() + ->get($queryKey, $this->_table->getComponentName()) + ->fetchOne($params, $hydrationMode); } /**