findByXXX/findOneByXXX does now also accept orderBy, limit and offset args
Conflicts: lib/Doctrine/ORM/EntityRepository.php
This commit is contained in:
parent
79d9c07652
commit
39ad87650e
@ -225,7 +225,16 @@ class EntityRepository implements ObjectRepository
|
||||
$fieldName = lcfirst(\Doctrine\Common\Util\Inflector::classify($by));
|
||||
|
||||
if ($this->_class->hasField($fieldName) || $this->_class->hasAssociation($fieldName)) {
|
||||
$argumentSize = sizeof($arguments);
|
||||
if ($argumentSize == 1) {
|
||||
return $this->$method(array($fieldName => $arguments[0]));
|
||||
} else if ($argumentSize == 2) {
|
||||
return $this->$method(array($fieldName => $arguments[0]), $arguments[1]);
|
||||
} else if ($argumentSize == 3) {
|
||||
return $this->$method(array($fieldName => $arguments[0]), $arguments[1], $arguments[2]);
|
||||
} else if ($argumentSize == 4) {
|
||||
return $this->$method(array($fieldName => $arguments[0]), $arguments[1], $arguments[2], $arguments[3]);
|
||||
}
|
||||
}
|
||||
|
||||
throw ORMException::invalidFindByCall($this->_entityName, $fieldName, $method.$by);
|
||||
|
Loading…
x
Reference in New Issue
Block a user