From 029071a14458f629b154988e17f393830ec8fc13 Mon Sep 17 00:00:00 2001 From: Brikou CARRE Date: Tue, 3 Apr 2012 17:33:00 +0200 Subject: [PATCH] simplified __call method --- lib/Doctrine/ORM/EntityRepository.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/EntityRepository.php b/lib/Doctrine/ORM/EntityRepository.php index 75cbf029e..38f3c90f0 100644 --- a/lib/Doctrine/ORM/EntityRepository.php +++ b/lib/Doctrine/ORM/EntityRepository.php @@ -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;