1
0
mirror of synced 2025-03-19 22:43:58 +03:00

Merge pull request #324 from brikou/call_simplified

simplified Doctrine/ORM/EntityRepository::__call
This commit is contained in:
Guilherme Blanco 2012-05-03 23:20:13 -07:00
commit 5fddd1bee5

View File

@ -225,13 +225,13 @@ class EntityRepository implements ObjectRepository
public function __call($method, $arguments)
{
switch (true) {
case (substr($method, 0, 6) == 'findBy'):
$by = substr($method, 6, strlen($method));
case (0 === strpos($method, 'findBy')):
$by = substr($method, 6);
$method = 'findBy';
break;
case (substr($method, 0, 9) == 'findOneBy'):
$by = substr($method, 9, strlen($method));
case (0 === strpos($method, 'findOneBy')):
$by = substr($method, 9);
$method = 'findOneBy';
break;