class Flag in Flag 8.4
Provides the Flag configuration entity.
Plugin annotation
@ConfigEntityType(
id = "flag",
label = @Translation("Flag"),
label_singular = @Translation("flag"),
label_plural = @Translation("flags"),
label_count = @PluralTranslation(
singular = "@count flag",
plural = "@count flags",
),
admin_permission = "administer flags",
handlers = {
"list_builder" = "Drupal\flag\Controller\FlagListBuilder",
"form" = {
"add" = "Drupal\flag\Form\FlagAddForm",
"edit" = "Drupal\flag\Form\FlagEditForm",
"delete" = "Drupal\Core\Entity\EntityDeleteForm"
}
},
bundle_of = "flagging",
entity_keys = {
"id" = "id",
"label" = "label",
"weight" = "weight",
},
config_export = {
"id",
"uuid",
"label",
"bundles",
"entity_type",
"global",
"weight",
"flag_short",
"flag_long",
"flag_message",
"unflag_short",
"unflag_long",
"unflag_message",
"unflag_denied_text",
"flag_type",
"link_type",
"flagTypeConfig",
"linkTypeConfig",
},
lookup_keys = {
"global",
},
links = {
"edit-form" = "/admin/structure/flags/manage/{flag}",
"delete-form" = "/admin/structure/flags/manage/{flag}/delete",
"collection" = "/admin/structure/flags",
"enable" = "/admin/structure/flags/manage/{flag}/enable",
"disable" = "/admin/structure/flags/manage/{flag}/disable",
"reset" = "/admin/structure/flags/manage/{flag}/reset"
}
)
Hierarchy
- class \Drupal\Core\Entity\EntityBase implements EntityInterface uses RefinableCacheableDependencyTrait, DependencySerializationTrait
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait
- class \Drupal\Core\Config\Entity\ConfigEntityBundleBase
- class \Drupal\flag\Entity\Flag implements FlagInterface
- class \Drupal\Core\Config\Entity\ConfigEntityBundleBase
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait
Expanded class hierarchy of Flag
11 files declare their use of Flag
- AccessTest.php in tests/
src/ Kernel/ AccessTest.php - AnonymousFlagTest.php in tests/
src/ Functional/ AnonymousFlagTest.php - FlagActionTest.php in tests/
src/ Kernel/ FlagActionTest.php - FlagBookmarkInstallUninstallTest.php in modules/
flag_bookmark/ tests/ src/ Kernel/ FlagBookmarkInstallUninstallTest.php - FlagContextualLinksTest.php in tests/
src/ FunctionalJavascript/ FlagContextualLinksTest.php
5 string references to 'Flag'
- flag.info.yml in ./
flag.info.yml - flag.info.yml
- flag.schema.yml in config/
schema/ flag.schema.yml - config/schema/flag.schema.yml
- FlagListBuilder::buildHeader in src/
Controller/ FlagListBuilder.php - Builds the header row for the entity listing.
- FlagViewsRelationship::buildOptionsForm in src/
Plugin/ views/ relationship/ FlagViewsRelationship.php - Provide a form to edit options for this plugin.
- flag_views_data_alter in ./
flag.views.inc - Implements hook_views_data_alter().
File
- src/
Entity/ Flag.php, line 73
Namespace
Drupal\flag\EntityView source
class Flag extends ConfigEntityBundleBase implements FlagInterface {
// @todo: Define flag reset method.
/**
* The entity type this flag works with.
*
* @var string
*/
protected $entity_type = NULL;
/**
* Whether this flag state should act as a single toggle to all users.
*
* @var bool
*/
protected $global = FALSE;
/**
* The bundles this flag applies to.
*
* This may be an empty array to indicate all bundles apply.
*
* @var array
*/
protected $bundles = [];
/**
* The text for the "flag this" link for this flag.
*
* @var string
*/
protected $flag_short = '';
/**
* The description of the "flag this" link.
*
* @var string
*/
protected $flag_long = '';
/**
* Message displayed after flagging an entity.
*
* @var string
*/
protected $flag_message = '';
/**
* The text for the "unflag this" link for this flag.
*
* @var string
*/
protected $unflag_short = '';
/**
* The description of the "unflag this" link.
*
* @var string
*/
protected $unflag_long = '';
/**
* Message displayed after flagging an entity.
*
* @var string
*/
protected $unflag_message = '';
/**
* Message displayed if users aren't allowed to unflag.
*
* @var string
*/
protected $unflag_denied_text = '';
/**
* The ID of the FlagType plugin.
*
* @var string
*/
protected $flag_type;
/**
* A collection to store the FlagType plugin.
*
* @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection
*/
protected $flagTypeCollection;
/**
* An array to store and load the FlagType plugin configuration.
*
* @var array
*/
protected $flagTypeConfig = [];
/**
* The ID of the ActionLink plugin.
*
* @var string
* @see \Drupal\flag\ActionLink\ActionLinkTypeBase
*/
protected $link_type = 'reload';
/**
* A collection to store the ActionLink plugin.
*
* @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection
*/
protected $linkTypeCollection;
/**
* An array to store and load the ActionLink plugin configuration.
*
* @var array
*/
protected $linkTypeConfig = [];
/**
* The weight of the flag.
*
* @var int
*/
protected $weight = 0;
/**
* {@inheritdoc}
*/
public function isFlagged(EntityInterface $entity, AccountInterface $account = NULL, $session_id = NULL) {
\Drupal::service('flag')
->populateFlaggerDefaults($account, $session_id);
// Load the is flagged list from the flagging storage, check if this flag
// is in the list.
$flag_ids = \Drupal::entityTypeManager()
->getStorage('flagging')
->loadIsFlagged($entity, $account, $session_id);
return isset($flag_ids[$this
->id()]);
}
/**
* {@inheritdoc}
*/
public function getFlaggableEntityTypeId() {
return $this->entity_type;
}
/**
* {@inheritdoc}
*/
public function getBundles() {
return $this->bundles;
}
/**
* {@inheritdoc}
*/
public function getApplicableBundles() {
$bundles = $this
->getBundles();
if (empty($bundles)) {
// If the setting is empty, return all bundle names for the flag's entity
// type.
/** @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info_service */
$bundle_info_service = \Drupal::service('entity_type.bundle.info');
$bundle_info = $bundle_info_service
->getBundleInfo($this->entity_type);
$bundles = array_keys($bundle_info);
}
return $bundles;
}
/**
* {@inheritdoc}
*/
public function getPluginCollections() {
return [
'flagTypeConfig' => $this
->getFlagTypeCollection(),
'linkTypeConfig' => $this
->getLinkTypeCollection(),
];
}
/**
* Encapsulates the creation of the flag type's plugin collection.
*
* @return \Drupal\Component\Plugin\DefaultSingleLazyPluginCollection
* The flag type's plugin collection.
*/
protected function getFlagTypeCollection() {
if (!$this->flagTypeCollection) {
$this->flagTypeCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.flag.flagtype'), $this->flag_type, $this->flagTypeConfig);
}
return $this->flagTypeCollection;
}
/**
* {@inheritdoc}
*/
public function getFlagTypePlugin() {
return $this
->getFlagTypeCollection()
->get($this->flag_type);
}
/**
* {@inheritdoc}
*/
public function setFlagTypePlugin($plugin_id) {
$this->flag_type = $plugin_id;
// $this->flagTypeBag->addInstanceId($pluginID);
// Workaround for https://www.drupal.org/node/2288805
$this->flagTypeCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.flag.flagtype'), $this->flag_type, $this->flagTypeConfig);
// Get the entity type from the plugin definition.
$plugin = $this
->getFlagTypePlugin();
$plugin_def = $plugin
->getPluginDefinition();
$this->entity_type = $plugin_def['entity_type'];
}
/**
* {@inheritdoc}
*/
public function getLinkTypePlugin() {
return $this
->getLinkTypeCollection()
->get($this->link_type);
}
/**
* Encapsulates the creation of the link type's plugin collection.
*
* @return \Drupal\Component\Plugin\DefaultSingleLazyPluginCollection
* The link type's plugin collection.
*/
protected function getLinkTypeCollection() {
if (!$this->linkTypeCollection) {
$this->linkTypeCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.flag.linktype'), $this->link_type, $this->linkTypeConfig);
}
return $this->linkTypeCollection;
}
/**
* {@inheritdoc}
*/
public function setlinkTypePlugin($plugin_id) {
$this->link_type = $plugin_id;
// $this->linkTypeBag->addInstanceId($pluginID);
// Workaround for https://www.drupal.org/node/2288805
$this->linkTypeCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.flag.linktype'), $this->link_type, $this->linkTypeConfig);
}
/**
* {@inheritdoc}
*/
public function actionPermissions() {
return $this
->getFlagTypePlugin()
->actionPermissions($this);
}
/**
* {@inheritdoc}
*/
public function actionAccess($action, AccountInterface $account = NULL, EntityInterface $flaggable = NULL) {
$account = $account ?: \Drupal::currentUser();
return $this
->getFlagTypePlugin()
->actionAccess($action, $this, $account, $flaggable);
}
/**
* {@inheritdoc}
*/
public function isGlobal() {
return $this->global;
}
/**
* {@inheritdoc}
*/
public function setGlobal($global = TRUE) {
if ($global) {
$this->global = TRUE;
}
else {
$this->global = FALSE;
}
}
/**
* {@inheritdoc}
*/
public function setFlagShortText($text) {
$this->flag_short = $text;
}
/**
* {@inheritdoc}
*/
public function getShortText($action) {
return $action === 'unflag' ? $this->unflag_short : $this->flag_short;
}
/**
* {@inheritdoc}
*/
public function getLongText($action) {
return $action === 'unflag' ? $this->unflag_long : $this->flag_long;
}
/**
* {@inheritdoc}
*/
public function setFlagLongText($flag_long) {
$this->flag_long = $flag_long;
}
/**
* {@inheritdoc}
*/
public function getMessage($action) {
return $action === 'unflag' ? $this->unflag_message : $this->flag_message;
}
/**
* {@inheritdoc}
*/
public function setFlagMessage($flag_message) {
$this->flag_message = $flag_message;
}
/**
* {@inheritdoc}
*/
public function setUnflagLongText($unflag_long) {
$this->unflag_long = $unflag_long;
}
/**
* {@inheritdoc}
*/
public function setUnflagMessage($unflag_message) {
$this->unflag_message = $unflag_message;
}
/**
* {@inheritdoc}
*/
public function setUnflagShortText($unflag_short) {
$this->unflag_short = $unflag_short;
}
/**
* {@inheritdoc}
*/
public function getUnflagDeniedText() {
return $this->unflag_denied_text;
}
/**
* {@inheritdoc}
*/
public function setUnflagDeniedText($unflag_denied_text) {
$this->unflag_denied_text = $unflag_denied_text;
}
/**
* {@inheritdoc}
*/
public function getWeight() {
return $this->weight;
}
/**
* {@inheritdoc}
*/
public function setWeight($weight) {
$this->weight = $weight;
}
/**
* {@inheritdoc}
*/
public function preSave(EntityStorageInterface $storage) {
parent::preSave($storage);
$bundles = array_filter($this
->get('bundles'));
sort($bundles);
$this
->set('bundles', $bundles);
/*
// Save the Flag Type configuration.
$flagTypePlugin = $this->getFlagTypePlugin();
$this->set('flagTypeConfig', $flagTypePlugin->getConfiguration());
// Save the Link Type configuration.
$linkTypePlugin = $this->getLinkTypePlugin();
$this->set('linkTypeConfig', $linkTypePlugin->getConfiguration());
*/
// Reset the render cache for the entity.
\Drupal::entityTypeManager()
->getViewBuilder($this
->getFlaggableEntityTypeId())
->resetCache();
// Clear entity extra field caches.
// @todo Inject the entity field manager into the object?
\Drupal::service('entity_field.manager')
->clearCachedFieldDefinitions();
}
/**
* {@inheritdoc}
*/
public static function preDelete(EntityStorageInterface $storage, array $entities) {
parent::preDelete($storage, $entities);
foreach ($entities as $flag) {
\Drupal::service('flag')
->unflagAllByFlag($flag);
}
}
/**
* {@inheritdoc}
*/
public function postSave(EntityStorageInterface $storage, $update = TRUE) {
parent::postSave($storage, $update);
if (\Drupal::moduleHandler()
->moduleExists('views')) {
// Rebuild views data to invalidate flag relationships.
\Drupal::service('views.views_data')
->clear();
}
\Drupal::service('plugin.manager.action')
->clearCachedDefinitions();
}
/**
* {@inheritdoc}
*/
public static function postDelete(EntityStorageInterface $storage, array $entities) {
parent::postDelete($storage, $entities);
if (\Drupal::moduleHandler()
->moduleExists('views')) {
// Rebuild views data to invalidate flag relationships.
\Drupal::service('views.views_data')
->clear();
}
\Drupal::service('plugin.manager.action')
->clearCachedDefinitions();
}
/**
* Sorts the flag entities, putting disabled flags at the bottom.
*
* @see \Drupal\Core\Config\Entity\ConfigEntityBase::sort()
*/
public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) {
// Check if the entities are flags, if not go with the default.
if ($a instanceof FlagInterface && $b instanceof FlagInterface) {
if ($a
->status() && $b
->status()) {
return parent::sort($a, $b);
}
elseif (!$a
->status()) {
return -1;
}
elseif (!$b
->status()) {
return 1;
}
}
return parent::sort($a, $b);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableDependencyTrait:: |
protected | property | Cache contexts. | |
CacheableDependencyTrait:: |
protected | property | Cache max-age. | |
CacheableDependencyTrait:: |
protected | property | Cache tags. | |
CacheableDependencyTrait:: |
protected | function | Sets cacheability; useful for value object constructors. | |
ConfigEntityBase:: |
private | property | Whether the config is being deleted by the uninstall process. | |
ConfigEntityBase:: |
protected | property | The language code of the entity's default language. | |
ConfigEntityBase:: |
protected | property | The original ID of the configuration entity. | |
ConfigEntityBase:: |
protected | property | The enabled/disabled status of the configuration entity. | 4 |
ConfigEntityBase:: |
protected | property | Third party entity settings. | |
ConfigEntityBase:: |
protected | property | Trust supplied data and not use configuration schema on save. | |
ConfigEntityBase:: |
protected | property | The UUID for this entity. | |
ConfigEntityBase:: |
protected | property | Information maintained by Drupal core about configuration. | |
ConfigEntityBase:: |
protected | function | Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). | |
ConfigEntityBase:: |
public | function |
Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityInterface:: |
13 |
ConfigEntityBase:: |
public | function |
Creates a duplicate of the entity. Overrides EntityBase:: |
1 |
ConfigEntityBase:: |
public | function |
Disables the configuration entity. Overrides ConfigEntityInterface:: |
1 |
ConfigEntityBase:: |
public | function |
Enables the configuration entity. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Returns the value of a property. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Returns the cache tags that should be used to invalidate caches. Overrides EntityBase:: |
1 |
ConfigEntityBase:: |
public | function |
Gets the configuration dependency name. Overrides EntityBase:: |
|
ConfigEntityBase:: |
protected static | function | Gets the configuration manager. | |
ConfigEntityBase:: |
public | function |
Gets the configuration target identifier for the entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Gets the configuration dependencies. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets the original ID. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Gets the list of third parties that store information. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets the value of a third-party setting. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets all third-party settings of a given module. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
protected | function | Gets the typed config manager. | |
ConfigEntityBase:: |
public | function |
Gets whether on not the data is trusted. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
protected static | function |
Override to never invalidate the individual entities' cache tags; the
config system already invalidates them. Overrides EntityBase:: |
|
ConfigEntityBase:: |
protected | function |
Override to never invalidate the entity's cache tag; the config system
already invalidates it. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Checks whether this entity is installable. Overrides ConfigEntityInterface:: |
2 |
ConfigEntityBase:: |
public | function |
Overrides Entity::isNew(). Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Returns whether this entity is being changed during the uninstall process. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Deprecated way of generating a link to the entity. See toLink(). Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityInterface:: |
7 |
ConfigEntityBase:: |
public | function |
Saves an entity permanently. Overrides EntityBase:: |
1 |
ConfigEntityBase:: |
public | function |
Sets the value of a property. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Sets the original ID. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Sets the status of the configuration entity. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Sets the value of a third-party setting. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function | ||
ConfigEntityBase:: |
public | function |
Returns whether the configuration entity is enabled. Overrides ConfigEntityInterface:: |
4 |
ConfigEntityBase:: |
public | function |
Gets an array of all property values. Overrides EntityBase:: |
2 |
ConfigEntityBase:: |
public | function |
Gets the URL object for the entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Sets that the data should be trusted. Overrides ConfigEntityInterface:: |
|
ConfigEntityBase:: |
public | function |
Unsets a third-party setting. Overrides ThirdPartySettingsInterface:: |
|
ConfigEntityBase:: |
public | function |
Gets the public URL for this entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Gets the URL object for the entity. Overrides EntityBase:: |
|
ConfigEntityBase:: |
public | function |
Constructs an Entity object. Overrides EntityBase:: |
10 |
ConfigEntityBase:: |
public | function |
Overrides EntityBase:: |
4 |
ConfigEntityBundleBase:: |
protected | function | Deletes display if a bundle is deleted. | |
ConfigEntityBundleBase:: |
protected | function | Returns view or form displays for this bundle. | |
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | Aliased as: traitSleep | 1 |
DependencySerializationTrait:: |
public | function | 2 | |
DependencyTrait:: |
protected | property | The object's dependencies. | |
DependencyTrait:: |
protected | function | Adds multiple dependencies. | |
DependencyTrait:: |
protected | function | Adds a dependency. Aliased as: addDependencyTrait | |
EntityBase:: |
protected | property | Boolean indicating whether the entity should be forced to be new. | |
EntityBase:: |
protected | property | The entity type. | |
EntityBase:: |
protected | property | A typed data object wrapping this entity. | |
EntityBase:: |
public | function |
Checks data value access. Overrides AccessibleInterface:: |
1 |
EntityBase:: |
public | function |
Gets the bundle of the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
public static | function |
Constructs a new entity object, without permanently saving it. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Deletes an entity permanently. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Enforces an entity to be new. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | Gets the entity manager. | |
EntityBase:: |
protected | function | Gets the entity type bundle info service. | |
EntityBase:: |
protected | function | Gets the entity type manager. | |
EntityBase:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
Gets the key that is used to store configuration dependencies. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the entity type definition. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the ID of the type of the entity. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | The list cache tags to invalidate for this entity. | |
EntityBase:: |
public | function |
Gets a typed data object for this entity object. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Indicates if a link template exists for a given key. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the identifier. Overrides EntityInterface:: |
11 |
EntityBase:: |
public | function |
Gets the label of the entity. Overrides EntityInterface:: |
6 |
EntityBase:: |
public | function |
Gets the language of the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets the language manager. | |
EntityBase:: |
protected | function | Gets an array link templates. | 1 |
EntityBase:: |
public static | function |
Loads an entity. Overrides EntityInterface:: |
|
EntityBase:: |
public static | function |
Loads one or more entities. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Acts on a created entity before hooks are invoked. Overrides EntityInterface:: |
4 |
EntityBase:: |
public static | function |
Acts on loaded entities. Overrides EntityInterface:: |
2 |
EntityBase:: |
public static | function |
Changes the values of an entity before it is created. Overrides EntityInterface:: |
5 |
EntityBase:: |
public | function |
Gets a list of entities referenced by this entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Generates the HTML for a link to this entity. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets a list of URI relationships supported by this entity. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | Gets an array of placeholders for this entity. | 2 |
EntityBase:: |
public | function |
Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets the UUID generator. | |
Flag:: |
protected | property | The bundles this flag applies to. | |
Flag:: |
protected | property | The entity type this flag works with. | |
Flag:: |
protected | property | A collection to store the FlagType plugin. | |
Flag:: |
protected | property | An array to store and load the FlagType plugin configuration. | |
Flag:: |
protected | property | The description of the "flag this" link. | |
Flag:: |
protected | property | Message displayed after flagging an entity. | |
Flag:: |
protected | property | The text for the "flag this" link for this flag. | |
Flag:: |
protected | property | The ID of the FlagType plugin. | |
Flag:: |
protected | property | Whether this flag state should act as a single toggle to all users. | |
Flag:: |
protected | property | A collection to store the ActionLink plugin. | |
Flag:: |
protected | property | An array to store and load the ActionLink plugin configuration. | |
Flag:: |
protected | property | The ID of the ActionLink plugin. | |
Flag:: |
protected | property | Message displayed if users aren't allowed to unflag. | |
Flag:: |
protected | property | The description of the "unflag this" link. | |
Flag:: |
protected | property | Message displayed after flagging an entity. | |
Flag:: |
protected | property | The text for the "unflag this" link for this flag. | |
Flag:: |
protected | property | The weight of the flag. | |
Flag:: |
public | function |
Checks whether a user has permission to flag/unflag or not. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Returns an associative array of permissions used by flag_permission(). Overrides FlagInterface:: |
|
Flag:: |
public | function |
Get the bundles this flag may be applied to. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Get the flag bundles property. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Returns the flaggable entity type ID. Overrides FlagInterface:: |
|
Flag:: |
protected | function | Encapsulates the creation of the flag type's plugin collection. | |
Flag:: |
public | function |
Get the flag type plugin. Overrides FlagInterface:: |
|
Flag:: |
protected | function | Encapsulates the creation of the link type's plugin collection. | |
Flag:: |
public | function |
Get the link type plugin for this flag. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Gets the flag long text. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Gets the flag message. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Gets the plugin collections used by this object. Overrides ObjectWithPluginCollectionInterface:: |
|
Flag:: |
public | function |
Gets the flag short text. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Get the flag's unflag denied message text. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Get the flag's weight. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Returns true of there's a flagging for this flag and the given entity. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Returns true if the flag is global, false otherwise. Overrides FlagInterface:: |
|
Flag:: |
public static | function |
Acts on deleted entities before the delete hook is invoked. Overrides ConfigEntityBundleBase:: |
|
Flag:: |
public | function |
Acts on a saved entity before the insert or update hook is invoked. Overrides ConfigEntityBundleBase:: |
|
Flag:: |
public static | function |
Acts on entities before they are deleted and before hooks are invoked. Overrides ConfigEntityBase:: |
|
Flag:: |
public | function |
Acts on an entity before the presave hook is invoked. Overrides ConfigEntityBundleBase:: |
|
Flag:: |
public | function |
Sets the flag long text. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Sets the flag message. Overrides FlagInterface:: |
|
Flag:: |
public | function |
The flag short text. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Set the flag type plugin. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Sets the flag as global or not. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Set the link type plugin. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Set's the flag's unflag denied message text. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Sets the unflag long text. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Sets the unflag message. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Sets the unflag short text. Overrides FlagInterface:: |
|
Flag:: |
public | function |
Set the flag's weight. Overrides FlagInterface:: |
|
Flag:: |
public static | function |
Sorts the flag entities, putting disabled flags at the bottom. Overrides ConfigEntityBase:: |
|
PluginDependencyTrait:: |
protected | function | Calculates and adds dependencies of a specific plugin instance. | 1 |
PluginDependencyTrait:: |
protected | function | Calculates and returns dependencies of a specific plugin instance. | |
PluginDependencyTrait:: |
protected | function | Wraps the module handler. | 1 |
PluginDependencyTrait:: |
protected | function | Wraps the theme handler. | 1 |
RefinableCacheableDependencyTrait:: |
public | function | 1 | |
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
SynchronizableEntityTrait:: |
protected | property | Whether this entity is being created, updated or deleted through a synchronization process. | |
SynchronizableEntityTrait:: |
public | function | ||
SynchronizableEntityTrait:: |
public | function |