1
0
mirror of synced 2025-01-18 14:31:40 +03:00
This commit is contained in:
zYne 2007-09-18 17:26:17 +00:00
parent ea8384129f
commit 15c4235faa
2 changed files with 40 additions and 3 deletions

View File

@ -158,7 +158,44 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
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
*

View File

@ -1399,7 +1399,7 @@ 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(), $hydrationMode = Doctrine::HYDRATE_RECORD)
public function find($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD)
{
return Doctrine_Manager::getInstance()
->getQueryRegistry()
@ -1418,7 +1418,7 @@ 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 fetchOne($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD)
public function findOne($queryKey, $params = array(), $hydrationMode = Doctrine::HYDRATE_RECORD)
{
return Doctrine_Manager::getInstance()
->getQueryRegistry()