You are here

class KeyType in Key 8

Defines a key type annotation object.

Hierarchy

Expanded class hierarchy of KeyType

5 classes are annotated with KeyType
AuthenticationKeyType in src/Plugin/KeyType/AuthenticationKeyType.php
Defines a generic key type for authentication.
AuthenticationMultivalueKeyType in src/Plugin/KeyType/AuthenticationMultivalueKeyType.php
Defines a generic key type for authentication with multiple values.
EncryptionKeyType in src/Plugin/KeyType/EncryptionKeyType.php
Defines a generic key type for encryption.
MultiValueKeyType in tests/modules/key_test/src/Plugin/KeyType/MultiValueKeyType.php
Defines a key type that is multi-value.
UserPasswordKeyType in src/Plugin/KeyType/UserPasswordKeyType.php
Defines a key that combines a user name and password.

File

src/Annotation/KeyType.php, line 12

Namespace

Drupal\key\Annotation
View source
class KeyType extends Plugin {

  /**
   * The plugin ID of the key type.
   *
   * @var string
   */
  public $id;

  /**
   * The human-readable name of the key type.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $label;

  /**
   * The description of the key type.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $description;

  /**
   * The group to which this key type belongs.
   *
   * This is the general category of this type of key. Examples include
   * "authentication" and "encryption". The default group is "none".
   *
   * @var string
   */
  public $group = 'none';

  /**
   * The settings to use when a key value can be submitted.
   *
   * This is used to indicate which key input plugin should be used
   * to receive the key value (if the provider accepts a key value).
   * The default key input plugin is text_field.
   *
   * @var array
   */
  public $key_value = [
    'plugin' => 'text_field',
  ];

  /**
   * The fields available in keys with multiple values.
   *
   * This is used to indicate if a key type supports multiple values and,
   * if so, information about its fields. Fields can be defined in either
   * of the following two formats.
   *
   * Simple:
   * "username" = @Translation("User name")
   *
   * Complex:
   * "password" = {
   *   "label" = @Translation("Password"),
   *   "required" = false
   * }
   *
   * Fields are assumed to be required, unless otherwise specified.
   *
   * @var array
   */
  public $multivalue = [
    'enabled' => FALSE,
    'fields' => [],
  ];

}

Members

Namesort descending Modifiers Type Description Overrides
KeyType::$description public property The description of the key type.
KeyType::$group public property The group to which this key type belongs.
KeyType::$id public property The plugin ID of the key type.
KeyType::$key_value public property The settings to use when a key value can be submitted.
KeyType::$label public property The human-readable name of the key type.
KeyType::$multivalue public property The fields available in keys with multiple values.
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::get public function Gets the value of an annotation. Overrides AnnotationInterface::get 5
Plugin::getClass public function Gets the class of the annotated class. Overrides AnnotationInterface::getClass
Plugin::getId public function Gets the unique ID for this annotated class. Overrides AnnotationInterface::getId
Plugin::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setClass public function Sets the class of the annotated class. Overrides AnnotationInterface::setClass
Plugin::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider
Plugin::__construct public function Constructs a Plugin object. 2