Exemplo n.º 1
0
 /**
  * @param \Codecasts\Restinga\Contracts\Service\Descriptor $service
  */
 public static function register(Descriptor $service)
 {
     $name = $service->service();
     if ($name) {
         self::$services[$name] = $service;
     }
 }
Exemplo n.º 2
0
 /**
  * @return string
  */
 public function url()
 {
     $url = $this->resource->getResourceName();
     if ($this->identified) {
         $identifier = $this->resource->getIdentifier();
         if ($identifier) {
             $url = $url . '/' . $identifier;
         }
     }
     if ($this->resource->hasParentResource()) {
         $current = $this->resource->getParentResource();
         while ($current) {
             $url = $current->getResourceName() . '/' . $current->getIdentifier() . '/' . $url;
             $current = $current->getParentResource();
         }
     }
     return $this->descriptor->prefix() . '/' . $url;
 }