Esempio n. 1
0
 /**
  * generate ro routes
  *
  * @param string $service       service name
  * @param string $resource      resource name
  * @param array  $serviceConfig service configuration
  *
  * @return void
  */
 public function loadReadOnlyRoutes($service, $resource, $serviceConfig)
 {
     $actionOptions = ActionUtils::getRouteOptions($service, $serviceConfig);
     $this->routes->add($resource . '.options', $actionOptions);
     $actionOptionsNoSlash = ActionUtils::getRouteOptions($service, $serviceConfig);
     $actionOptionsNoSlash->setPath(substr($actionOptionsNoSlash->getPath(), 0, -1));
     $this->routes->add($resource . '.optionsNoSlash', $actionOptionsNoSlash);
     $actionHead = ActionUtils::getRouteHead($service, $serviceConfig);
     $this->routes->add($resource . '.head', $actionHead);
     $actionHead = ActionUtils::getRouteHead($service, $serviceConfig, array(), true);
     $this->routes->add($resource . '.idHead', $actionHead);
     $actionGet = ActionUtils::getRouteGet($service, $serviceConfig);
     $this->routes->add($resource . '.get', $actionGet);
     $actionAll = ActionUtils::getRouteAll($service, $serviceConfig);
     $this->routes->add($resource . '.all', $actionAll);
     $actionOptions = ActionUtils::getCanonicalSchemaRoute($service, $serviceConfig, 'collection');
     $this->routes->add($resource . '.canonicalSchema', $actionOptions);
     $actionOptions = ActionUtils::getCanonicalSchemaRoute($service, $serviceConfig, 'collection', true);
     $this->routes->add($resource . '.canonicalSchemaOptions', $actionOptions);
     $actionOptions = ActionUtils::getCanonicalSchemaRoute($service, $serviceConfig);
     $this->routes->add($resource . '.canonicalIdSchema', $actionOptions);
     $actionOptions = ActionUtils::getCanonicalSchemaRoute($service, $serviceConfig, 'item', true);
     $this->routes->add($resource . '.canonicalIdSchemaOptions', $actionOptions);
     $actionOptions = ActionUtils::getRouteOptions($service, $serviceConfig, array(), true);
     $this->routes->add($resource . '.idOptions', $actionOptions);
 }
Esempio n. 2
0
 /**
  * generate ro routes
  *
  * @param string $service       service name
  * @param string $resource      resource name
  * @param array  $serviceConfig service configuration
  *
  * @return void
  */
 public function loadReadOnlyRoutes($service, $resource, $serviceConfig)
 {
     $actionGet = ActionUtils::getRouteGet($service, $serviceConfig);
     $this->routes->add($resource . '.get', $actionGet);
     $actionAll = ActionUtils::getRouteAll($service, $serviceConfig);
     $this->routes->add($resource . '.all', $actionAll);
     $actionOptions = ActionUtils::getRouteOptions($service, $serviceConfig);
     $this->routes->add($resource . '.options', $actionOptions);
     $actionOptions = ActionUtils::getCanonicalSchemaRoute($service, $serviceConfig, 'collection');
     $this->routes->add($resource . '.canonicalSchema', $actionOptions);
     $actionOptions = ActionUtils::getCanonicalSchemaRoute($service, $serviceConfig, 'collection', true);
     $this->routes->add($resource . '.canonicalSchemaOptions', $actionOptions);
     $actionOptions = ActionUtils::getCanonicalSchemaRoute($service, $serviceConfig);
     $this->routes->add($resource . '.canonicalIdSchema', $actionOptions);
     $actionOptions = ActionUtils::getCanonicalSchemaRoute($service, $serviceConfig, 'item', true);
     $this->routes->add($resource . '.canonicalIdSchemaOptions', $actionOptions);
     $actionOptions = ActionUtils::getRouteOptions($service, $serviceConfig, array(), true);
     $this->routes->add($resource . '.idOptions', $actionOptions);
 }