interface ApiTokenPluginInterface in API Tokens 8.2
Same name and namespace in other branches
- 8 src/ApiTokenPluginInterface.php \Drupal\api_tokens\ApiTokenPluginInterface
Defines the interface for the API token plugins.
API tokens are discovered through annotations, which may contain the following definition properties:
- id: (required) The API token ID.
- label: (required) The administrative label of the API token.
- description: The administrative description of the API token.
Hierarchy
- interface \Drupal\Core\Plugin\ContainerFactoryPluginInterface; interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Core\Cache\RefinableCacheableDependencyInterface
- interface \Drupal\api_tokens\ApiTokenPluginInterface
Expanded class hierarchy of ApiTokenPluginInterface
All classes that implement ApiTokenPluginInterface
1 file declares its use of ApiTokenPluginInterface
- api_tokens.api.php in ./
api_tokens.api.php - Hooks provided by the API Tokens module.
File
- src/
ApiTokenPluginInterface.php, line 18
Namespace
Drupal\api_tokensView source
interface ApiTokenPluginInterface extends ContainerFactoryPluginInterface, PluginInspectionInterface, RefinableCacheableDependencyInterface {
/**
* Returns the API token ID.
*
* @return string
*/
public function id();
/**
* Returns the administrative label of the API token.
*
* @return string
*/
public function label();
/**
* Returns the administrative description of the API token.
*
* @return string
*/
public function description();
/**
* Returns the name of the provider that owns this API token.
*
* @return string
*/
public function provider();
/**
* Returns the API token string.
*
* @return string
*/
public function token();
/**
* Returns the API token parameter string.
*
* @return string
*/
public function paramString();
/**
* Returns the API token parameters.
*
* @return array
*/
public function params();
/**
* Returns the API token parameters hash.
*
* @return string
*/
public function hash();
/**
* Returns the API token build method reflection object.
*
* @return \ReflectionMethod|null
*/
public function reflector();
/**
* Performs one-time context-independent validation of the API token.
*
* @return bool
*/
public function validateToken();
/**
* Returns processed API token build.
*
* @return array
* A renderable array for the API token output.
*/
public function process();
/**
* Returns a build to replace the API token with in case of validation fail.
*
* @return array
* A renderable array.
*/
public function fallback();
/**
* Returns a #lazy_builder placeholder for the API tokens filter.
*
* @return array
* A renderable array representing a placeholder.
*/
public function placeholder();
/**
* The #lazy_builder callback.
*
* @param string $id
* The API token ID.
* @param string $params
* Parameters part of the API token string.
* @param bool $valid
* Whether the API token is valid.
*
* @return array
* A renderable array for the API token output.
*/
public static function lazyBuilder($id, $params, $valid);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ApiTokenPluginInterface:: |
public | function | Returns the administrative description of the API token. | 1 |
ApiTokenPluginInterface:: |
public | function | Returns a build to replace the API token with in case of validation fail. | 1 |
ApiTokenPluginInterface:: |
public | function | Returns the API token parameters hash. | 1 |
ApiTokenPluginInterface:: |
public | function | Returns the API token ID. | 1 |
ApiTokenPluginInterface:: |
public | function | Returns the administrative label of the API token. | 1 |
ApiTokenPluginInterface:: |
public static | function | The #lazy_builder callback. | 1 |
ApiTokenPluginInterface:: |
public | function | Returns the API token parameters. | 1 |
ApiTokenPluginInterface:: |
public | function | Returns the API token parameter string. | 1 |
ApiTokenPluginInterface:: |
public | function | Returns a #lazy_builder placeholder for the API tokens filter. | 1 |
ApiTokenPluginInterface:: |
public | function | Returns processed API token build. | 1 |
ApiTokenPluginInterface:: |
public | function | Returns the name of the provider that owns this API token. | 1 |
ApiTokenPluginInterface:: |
public | function | Returns the API token build method reflection object. | 1 |
ApiTokenPluginInterface:: |
public | function | Returns the API token string. | 1 |
ApiTokenPluginInterface:: |
public | function | Performs one-time context-independent validation of the API token. | 1 |
CacheableDependencyInterface:: |
public | function | The cache contexts associated with this object. | 34 |
CacheableDependencyInterface:: |
public | function | The maximum age for which this object may be cached. | 34 |
CacheableDependencyInterface:: |
public | function | The cache tags associated with this object. | 27 |
ContainerFactoryPluginInterface:: |
public static | function | Creates an instance of the plugin. | 112 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |
RefinableCacheableDependencyInterface:: |
public | function | Adds a dependency on an object: merges its cacheability metadata. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Adds cache contexts. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Adds cache tags. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Merges the maximum age (in seconds) with the existing maximum age. | 1 |