You are here

interface FlagTypePluginInterface in Flag 8.4

Provides an interface for all flag type plugins.

Hierarchy

Expanded class hierarchy of FlagTypePluginInterface

All classes that implement FlagTypePluginInterface

File

src/FlagType/FlagTypePluginInterface.php, line 15

Namespace

Drupal\flag\FlagType
View source
interface FlagTypePluginInterface extends PluginFormInterface, ConfigurableInterface, ContainerFactoryPluginInterface {

  /**
   * Returns the permissions available to this flag type.
   *
   * @param \Drupal\flag\FlagInterface $flag
   *   The flag object.
   *
   * @return array
   *   An array of permissions.
   */
  public function actionPermissions(FlagInterface $flag);

  /**
   * Checks whether a user has permission to flag/unflag or not.
   *
   * @param string $action
   *   The action for which to check permissions, either 'flag' or 'unflag'.
   * @param \Drupal\flag\FlagInterface $flag
   *   The flag object.
   * @param \Drupal\Core\Session\AccountInterface $account
   *   An AccountInterface object.
   * @param \Drupal\Core\Entity\EntityInterface $flaggable
   *   (optional) The flaggable entity.
   *
   * @return \Drupal\Core\Access\AccessResult
   *   An AccessResult object.
   */
  public function actionAccess($action, FlagInterface $flag, AccountInterface $account, EntityInterface $flaggable = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
FlagTypePluginInterface::actionAccess public function Checks whether a user has permission to flag/unflag or not. 1
FlagTypePluginInterface::actionPermissions public function Returns the permissions available to this flag type. 1
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18