Beispiel #1
0
 /**
  * @param \Artesaos\Restinga\Contracts\Service\Descriptor $service
  */
 public static function register(Descriptor $service)
 {
     $name = $service->service();
     if ($name) {
         self::$services[$name] = $service;
     }
 }
Beispiel #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();
         }
     }
     if ($this->append) {
         $url = $url . $this->append;
     }
     return $this->descriptor->prefix() . '/' . $url;
 }