Beispiel #1
0
 /**
  * generate write routes
  *
  * @param string $service       service name
  * @param string $resource      resource name
  * @param array  $serviceConfig service configuration
  *
  * @return void
  */
 public function loadWriteRoutes($service, $resource, $serviceConfig)
 {
     $actionPost = ActionUtils::getRoutePost($service, $serviceConfig);
     $this->routes->add($resource . '.post', $actionPost);
     $actionPut = ActionUtils::getRoutePut($service, $serviceConfig);
     $this->routes->add($resource . '.put', $actionPut);
     $actionPostNoSlash = ActionUtils::getRoutePost($service, $serviceConfig);
     $actionPostNoSlash->setPath(substr($actionPostNoSlash->getPath(), 0, -1));
     $this->routes->add($resource . '.postNoSlash', $actionPostNoSlash);
     $actionPatch = ActionUtils::getRoutePatch($service, $serviceConfig);
     $this->routes->add($resource . '.patch', $actionPatch);
     $actionDelete = ActionUtils::getRouteDelete($service, $serviceConfig);
     $this->routes->add($resource . '.delete', $actionDelete);
 }
Beispiel #2
0
 /**
  * generate write routes
  *
  * @param string $service       service name
  * @param string $resource      resource name
  * @param array  $serviceConfig service configuration
  *
  * @return void
  */
 public function loadWriteRoutes($service, $resource, $serviceConfig)
 {
     $actionPost = ActionUtils::getRoutePost($service, $serviceConfig);
     $this->routes->add($resource . '.post', $actionPost);
     $actionPut = ActionUtils::getRoutePut($service, $serviceConfig);
     $this->routes->add($resource . '.put', $actionPut);
     $actionDelete = ActionUtils::getRouteDelete($service, $serviceConfig);
     $this->routes->add($resource . '.delete', $actionDelete);
 }