protected function callRepositoryMethod(string $method, ...$args)
    {
        $om = $this->getManager();
        $repo = $om->getRepository($this->getEntity());

        if (!method_exists($repo, $method) || !is_callable([$repo, $method])) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Method "%s" doesn\'t exist or isn\'t callable in EntityRepository "%s"',
                    $method,
                    get_class($repo)
                )
            );
        }

        return $repo->$method(...$args);
    }
protected function callRepositoryMethod(string $method, ...$args)
    {
        $om = $this->getManager();
        $repo = $om->getRepository($this->getEntity());

        if (!method_exists($repo, $method) || !is_callable([$repo, $method])) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Method "%s" doesn\'t exist or isn\'t callable in EntityRepository "%s"',
                    $method,
                    get_class($repo)
                )
            );
        }

        return $repo->$method(...$args);
    }
protected function callRepositoryMethod ( string $ method , ... $ args ) { $ om = $ this -> getManager ( ) ; $ repo = $ om -> getRepository ( $ this -> getEntity ( ) ) ; if ( ! method_exists ( $ repo , $ method ) || ! is_callable ( [ $ repo , $ method ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Method "%s" doesn\'t exist or isn\'t callable in EntityRepository "%s"' , $ method , get_class ( $ repo ) ) ) ; } return $ repo -> $ method ( ... $ args ) ; }
Call a given method on an EntityRepository.

@param string $method
@param mixed  ...$args

@return mixed
Call a given method on an EntityRepository .