1
0
mirror of synced 2025-02-06 15:29:26 +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) public function __call($method, $arguments)
{ {
switch (true) { switch (true) {
case (substr($method, 0, 6) == 'findBy'): case (0 === strpos($method, 'findBy')):
$by = substr($method, 6, strlen($method)); $by = substr($method, 6);
$method = 'findBy'; $method = 'findBy';
break; break;
case (substr($method, 0, 9) == 'findOneBy'): case (0 === strpos($method, 'findOneBy')):
$by = substr($method, 9, strlen($method)); $by = substr($method, 9);
$method = 'findOneBy'; $method = 'findOneBy';
break; break;