Beispiel #1
0
 /**
  * Implement to return the resource configuration for this REST handling object
  *
  * @param boolean $only_handlers
  *
  * @return array Empty when not implemented, otherwise the array of resource information
  */
 public function getResources($only_handlers = false)
 {
     if (!$only_handlers) {
         $resources = [];
         $cacheables = ServiceCacheConfig::with('service')->whereCacheEnabled(true)->get();
         /** @type ServiceCacheConfig $cacheable */
         foreach ($cacheables as $cacheable) {
             $resources[] = ['name' => $cacheable->service->name, 'label' => $cacheable->service->label];
         }
         return $resources;
     }
     return [];
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public static function getConfigSchema()
 {
     $schema = parent::getConfigSchema();
     $schema[] = ParameterConfig::getConfigSchema();
     $schema[] = HeaderConfig::getConfigSchema();
     $schema = array_merge($schema, ServiceCacheConfig::getConfigSchema());
     return $schema;
 }