TcaPluginBase.php in Token Content Access 2.0.x
File
src/Plugin/TcaPluginBase.php
View source
<?php
namespace Drupal\tca\Plugin;
use Drupal\Component\Plugin\PluginBase;
abstract class TcaPluginBase extends PluginBase implements TcaPluginInterface {
public function isFieldable() {
return FALSE;
}
public function getFormSubmitHandlerAttachLocations() {
return [
[
'actions',
'submit',
'#submit',
],
];
}
public function getBundleFormSubmitHandlerAttachLocations() {
return [
[
'actions',
'submit',
'#submit',
],
];
}
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;
}
}