Пример #1
0
 public function doIndex()
 {
     $resourceListing = new ResourceListing('1.0');
     $resources = $this->resourceListing->getResourceIndex();
     foreach ($resources as $resource) {
         $path = '/*';
         $path .= ApiGeneration::transformRoutePlaceholder($resource->getPath());
         $resourceListing->addResource(new ResourceObject($path));
     }
     $this->setBody($resourceListing, WriterInterface::JSON);
 }
Пример #2
0
 protected function getRoutings()
 {
     $routings = array();
     $resources = $this->resourceListing->getResourceIndex();
     foreach ($resources as $resource) {
         $routings[] = new Record('routing', ['path' => $resource->getPath(), 'methods' => $resource->getAllowedMethods(), 'version' => '*']);
     }
     return $routings;
 }