You are here

interface UserRestrictionTypeInterface in User restrictions 8

Defines the interface for UserRestrictionType plugins.

Hierarchy

Expanded class hierarchy of UserRestrictionTypeInterface

All classes that implement UserRestrictionTypeInterface

1 file declares its use of UserRestrictionTypeInterface
UserRestrictionTypeBase.php in src/Plugin/UserRestrictionType/UserRestrictionTypeBase.php

File

src/Plugin/UserRestrictionTypeInterface.php, line 10

Namespace

Drupal\user_restrictions\Plugin
View source
interface UserRestrictionTypeInterface extends ContainerFactoryPluginInterface {

  /**
   * Check if the given data matches the restriction.
   *
   * @param array $data
   *   Data to check.
   *
   * @return bool
   *   TRUE if the value matches one of the restrictions, FALSE otherwise.
   */
  public function matches(array $data);

  /**
   * Get the list of regular expression patterns of the type.
   *
   * @return string[]
   *   Array with regular expression patterns.
   */
  public function getPatterns();

  /**
   * Get the plugin label.
   *
   * @return string
   *   The plugin label.
   */
  public function getLabel();

  /**
   * Get error message displayed to the user.
   *
   * @return string
   *   Error message.
   */
  public function getErrorMessage();

}

Members

Namesort descending Modifiers Type Description Overrides
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
UserRestrictionTypeInterface::getErrorMessage public function Get error message displayed to the user. 1
UserRestrictionTypeInterface::getLabel public function Get the plugin label. 1
UserRestrictionTypeInterface::getPatterns public function Get the list of regular expression patterns of the type. 1
UserRestrictionTypeInterface::matches public function Check if the given data matches the restriction. 3