interface FlagTypePluginInterface in Flag 8.4
Provides an interface for all flag type plugins.
Hierarchy
- interface \Drupal\Core\Plugin\PluginFormInterface; interface \Drupal\Component\Plugin\ConfigurableInterface; interface \Drupal\Core\Plugin\ContainerFactoryPluginInterface
- interface \Drupal\flag\FlagType\FlagTypePluginInterface
Expanded class hierarchy of FlagTypePluginInterface
All classes that implement FlagTypePluginInterface
File
- src/
FlagType/ FlagTypePluginInterface.php, line 15
Namespace
Drupal\flag\FlagTypeView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurableInterface:: |
public | function | Gets default configuration for this plugin. | 11 |
ConfigurableInterface:: |
public | function | Gets this plugin's configuration. | 12 |
ConfigurableInterface:: |
public | function | Sets the configuration for this plugin instance. | 12 |
ContainerFactoryPluginInterface:: |
public static | function | Creates an instance of the plugin. | 112 |
FlagTypePluginInterface:: |
public | function | Checks whether a user has permission to flag/unflag or not. | 1 |
FlagTypePluginInterface:: |
public | function | Returns the permissions available to this flag type. | 1 |
PluginFormInterface:: |
public | function | Form constructor. | 36 |
PluginFormInterface:: |
public | function | Form submission handler. | 32 |
PluginFormInterface:: |
public | function | Form validation handler. | 18 |