public function discoverAction() { $module = $this->params()->fromRoute('name'); $version = $this->params()->fromRoute('version'); $adapter = $this->params()->fromRoute('object_manager_alias'); $data = $this->model->fetchFields($module, $version, $adapter); return new ViewModel(array('payload' => $data)); }
/** * @param ContainerInterface $container * @return DoctrineAutodiscoveryModel */ public function __invoke(ContainerInterface $container) { if (!$container->has('config')) { throw new ServiceNotCreatedException(sprintf('Cannot create %s service because config service is not present', DoctrineAutodiscoveryModel::class)); } $instance = new DoctrineAutodiscoveryModel($container->get('config')); $instance->setServiceLocator($container); return $instance; }