You are here

abstract class TcaPluginBase in Token Content Access 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/TcaPluginBase.php \Drupal\tca\Plugin\TcaPluginBase

Base class for TCA plugins.

Hierarchy

Expanded class hierarchy of TcaPluginBase

2 files declare their use of TcaPluginBase
Node.php in modules/tca_node/src/Plugin/TcaPlugin/Node.php
Product.php in modules/tca_commerce_product/src/Plugin/TcaPlugin/Product.php

File

src/Plugin/TcaPluginBase.php, line 10

Namespace

Drupal\tca\Plugin
View source
abstract class TcaPluginBase extends PluginBase implements TcaPluginInterface {

  /**
   * {@inheritdoc}
   */
  public function isFieldable() {
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function getFormSubmitHandlerAttachLocations() {
    return [
      [
        'actions',
        'submit',
        '#submit',
      ],
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getBundleFormSubmitHandlerAttachLocations() {
    return [
      [
        'actions',
        'submit',
        '#submit',
      ],
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getEntityTokenMap() {
    $map = [];
    $map[$this->pluginDefinition['entityType']] = $this->pluginDefinition['entityType'];
    $bundle = \Drupal::entityTypeManager()
      ->getDefinition($this->pluginDefinition['entityType'])
      ->getBundleEntityType();
    if (!empty($bundle)) {
      $map[$bundle] = $bundle;
    }
    return $map;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 2
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. 98
TcaPluginBase::getBundleFormSubmitHandlerAttachLocations public function Return locations to attach submit handlers to entity bundles. Overrides TcaPluginInterface::getBundleFormSubmitHandlerAttachLocations 2
TcaPluginBase::getEntityTokenMap public function Return a map of entity IDs used by this plugin to token IDs. Overrides TcaPluginInterface::getEntityTokenMap
TcaPluginBase::getFormSubmitHandlerAttachLocations public function Return locations to attach submit handlers to entities. Overrides TcaPluginInterface::getFormSubmitHandlerAttachLocations 2
TcaPluginBase::isFieldable public function The fildable mark. Overrides TcaPluginInterface::isFieldable 2