/** * 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 []; }
/** * {@inheritdoc} */ public static function getConfigSchema() { $schema = parent::getConfigSchema(); $schema[] = ParameterConfig::getConfigSchema(); $schema[] = HeaderConfig::getConfigSchema(); $schema = array_merge($schema, ServiceCacheConfig::getConfigSchema()); return $schema; }