1
0
mirror of synced 2025-01-29 19:41:45 +03:00

simplified __call method

This commit is contained in:
Brikou CARRE 2012-04-03 17:33:00 +02:00
parent 5b18718b92
commit 029071a144

View File

@ -210,13 +210,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;