/** * Get resources via repository based on the configuration. * * @param RepositoryInterface $repository * @param string $defaultMethod * @param array $defaultArguments * * @return mixed */ public function getResource(RepositoryInterface $repository, $defaultMethod, array $defaultArguments = array()) { $callable = array($repository, $this->config->getMethod($defaultMethod)); $arguments = $this->config->getArguments($defaultArguments); return call_user_func_array($callable, $arguments); }