/** * Constructor. * * @param array $data An array of key/value parameters. * * @throws \BadMethodCallException */ public function __construct(array $data) { if (isset($data['value'])) { $data['path'] = $data['value']; unset($data['value']); } foreach ($data as $key => $value) { $method = 'set' . str_replace('_', '', $key); if (!method_exists($this, $method)) { throw new \BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $key, get_class($this))); } $this->{$method}($value); } $service = ListWebservices::getInstance(); $service->addService($this); }
/** * @Route("/debugger", name="es_ws_debugger") * @Template() */ public function DebuggerAction() { $forms = array(); //Add manuel webservices $config_services = $this->container->getParameter('es_webservices'); if ($config_services) { foreach ($config_services as $ws) { $forms[] = json_encode($ws); } } //Add Annotation webservices $services = ListWebservices::getInstance(); foreach ($services->getServices() as $ws) { $forms[] = (string) $ws; } return $this->render('EsWebservicesBundle:Default:index.html.twig', array('forms' => implode(',', $forms))); }