1
0
mirror of synced 2024-12-14 15:16:04 +03:00

Reverted PR #86, which broke our suite.

This commit is contained in:
Guilherme Blanco 2011-07-22 11:38:20 -03:00
parent 4be7c3dac0
commit 4b85d7a683
2 changed files with 3 additions and 4 deletions

View File

@ -178,7 +178,7 @@ class EntityRepository implements ObjectRepository
*/ */
public function findOneBy(array $criteria) public function findOneBy(array $criteria)
{ {
return $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName)->load($criteria, null, null, array(), 0, 1); return $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName)->load($criteria);
} }
/** /**

View File

@ -559,13 +559,12 @@ class BasicEntityPersister
* @param $assoc The association that connects the entity to load to another entity, if any. * @param $assoc The association that connects the entity to load to another entity, if any.
* @param array $hints Hints for entity creation. * @param array $hints Hints for entity creation.
* @param int $lockMode * @param int $lockMode
* @param int $limit Limit number of results
* @return object The loaded and managed entity instance or NULL if the entity can not be found. * @return object The loaded and managed entity instance or NULL if the entity can not be found.
* @todo Check identity map? loadById method? Try to guess whether $criteria is the id? * @todo Check identity map? loadById method? Try to guess whether $criteria is the id?
*/ */
public function load(array $criteria, $entity = null, $assoc = null, array $hints = array(), $lockMode = 0, $limit = 0) public function load(array $criteria, $entity = null, $assoc = null, array $hints = array(), $lockMode = 0)
{ {
$sql = $this->_getSelectEntitiesSQL($criteria, $assoc, $lockMode, $limit); $sql = $this->_getSelectEntitiesSQL($criteria, $assoc, $lockMode);
list($params, $types) = $this->expandParameters($criteria); list($params, $types) = $this->expandParameters($criteria);
$stmt = $this->_conn->executeQuery($sql, $params, $types); $stmt = $this->_conn->executeQuery($sql, $params, $types);