Commit 15c4235f authored by zYne's avatar zYne

--no commit message

--no commit message
parent ea838412
...@@ -158,7 +158,44 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera ...@@ -158,7 +158,44 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
return $this; return $this;
} }
/**
* fetch
* 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 find($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD)
{
return Doctrine_Manager::getInstance()
->getQueryRegistry()
->get($queryKey)
->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 findOne($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD)
{
return Doctrine_Manager::getInstance()
->getQueryRegistry()
->get($queryKey)
->fetchOne($params, $hydrationMode);
}
/** /**
* connection * connection
* *
......
...@@ -1399,7 +1399,7 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count ...@@ -1399,7 +1399,7 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
* @param array $params prepared statement params (if any) * @param array $params prepared statement params (if any)
* @return mixed the fetched data * @return mixed the fetched data
*/ */
public function fetch($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD) public function find($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD)
{ {
return Doctrine_Manager::getInstance() return Doctrine_Manager::getInstance()
->getQueryRegistry() ->getQueryRegistry()
...@@ -1418,7 +1418,7 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count ...@@ -1418,7 +1418,7 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
* @param array $params prepared statement params (if any) * @param array $params prepared statement params (if any)
* @return mixed the fetched data * @return mixed the fetched data
*/ */
public function fetchOne($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD) public function findOne($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD)
{ {
return Doctrine_Manager::getInstance() return Doctrine_Manager::getInstance()
->getQueryRegistry() ->getQueryRegistry()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment