lib/Doctrine/ORM/EntityRepository.php
private function resolveMagicCall($method, $by, array $arguments)
    {
        if (! $arguments) {
            throw InvalidMagicMethodCall::onMissingParameter($method . $by);
        }

        $fieldName = lcfirst(Inflector::classify($by));

        if ($this->class->getProperty($fieldName) === null) {
            throw InvalidMagicMethodCall::becauseFieldNotFoundIn(
                $this->entityName,
                $fieldName,
                $method . $by
            );
        }

        return $this->{$method}([$fieldName => $arguments[0]], ...array_slice($arguments, 1));
    }
private function resolveMagicCall($method, $by, array $arguments)
    {
        if (! $arguments) {
            throw InvalidMagicMethodCall::onMissingParameter($method . $by);
        }

        $fieldName = lcfirst(Inflector::classify($by));

        if ($this->class->getProperty($fieldName) === null) {
            throw InvalidMagicMethodCall::becauseFieldNotFoundIn(
                $this->entityName,
                $fieldName,
                $method . $by
            );
        }

        return $this->{$method}([$fieldName => $arguments[0]], ...array_slice($arguments, 1));
    }
private function resolveMagicCall ( $ method , $ by , array $ arguments ) { if ( ! $ arguments ) { throw InvalidMagicMethodCall :: onMissingParameter ( $ method . $ by ) ; } $ fieldName = lcfirst ( Inflector :: classify ( $ by ) ) ; if ( $ this -> class -> getProperty ( $ fieldName ) === null ) { throw InvalidMagicMethodCall :: becauseFieldNotFoundIn ( $ this -> entityName , $ fieldName , $ method . $ by ) ; } return $ this -> { $ method } ( [ $ fieldName => $ arguments [ 0 ] ] , ... array_slice ( $ arguments , 1 ) ) ; }
Resolves a magic method call to the proper existent method at `EntityRepository`.

@param string  $method    The method to call
@param string  $by        The property name used as condition
@param mixed[] $arguments The arguments to pass at method call

@return mixed

@throws ORMException If the method called is invalid or the requested field/association does not exist.
Resolves a magic method call to the proper existent method at EntityRepository .