/** * Create the ExtDirect API based on controllers files. * * @return string JSON description of Direct API */ protected function createApi() { $bundles = $this->getControllers(); $actions = array(); foreach ($bundles as $bundle => $controllers) { $bundleShortName = str_replace('Bundle', '', $bundle); foreach ($controllers as $controller) { $api = new ControllerApi($this->container, $controller); if ($api->isExposed()) { $actions[$bundleShortName . '_' . $api->getActionName()] = $api->getApi(); } } } return array('url' => $this->container->get('request')->getBaseUrl() . $this->container->getParameter('direct.api.route_pattern'), 'type' => $this->container->getParameter('direct.api.type'), 'namespace' => $this->container->getParameter('direct.api.namespace'), 'id' => $this->container->getParameter('direct.api.id'), 'actions' => $actions); }
public function beforeTestMethod($method) { $this->kernel = new \AppKernel('test', true); $this->kernel->boot(); // Store the container and the entity manager in test case properties $this->container = $this->kernel->getContainer(); $managerRegistry = $this->container->get('doctrine'); $this->exportManager = new \AppBundle\Manager\ExportManager($managerRegistry, $this->container->get('session'), $this->container->get('genericentitymanager'), $this->container->getParameter('maxitemperpage')[1], $this->container->get('diff.computer'), $this->container->getParameter('user_group')); $user = new User('tpateffoz', $this->container->getParameter('api_recolnat_base_uri'), $this->container->getParameter('api_recolnat_user_path'), $this->container->getParameter('user_group')); $user->setExportPath($this->container->getParameter('export_path')); $collection = $this->container->get('utility')->getCollection('MHNAIX', 'AIX'); $this->exportManager->init($user)->setCollection($collection); }
public function getContentFields() { return $this->container->getParameter('fields'); }