class EntityFormField in Views Entity Form Field 8
Defines a views form element for an entity field widget.
Plugin annotation
@ViewsField("entity_form_field");
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\views\Plugin\views\PluginBase implements DependentPluginInterface, ContainerFactoryPluginInterface, TrustedCallbackInterface, ViewsPluginInterface
- class \Drupal\views\Plugin\views\HandlerBase implements ViewsHandlerInterface
- class \Drupal\views\Plugin\views\field\FieldPluginBase implements FieldHandlerInterface
- class \Drupal\views_entity_form_field\Plugin\views\field\EntityFormField implements CacheableDependencyInterface, DependentWithRemovalPluginInterface uses PluginDependencyTrait, EntityTranslationRenderTrait, UncacheableFieldHandlerTrait
- class \Drupal\views\Plugin\views\field\FieldPluginBase implements FieldHandlerInterface
- class \Drupal\views\Plugin\views\HandlerBase implements ViewsHandlerInterface
- class \Drupal\views\Plugin\views\PluginBase implements DependentPluginInterface, ContainerFactoryPluginInterface, TrustedCallbackInterface, ViewsPluginInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of EntityFormField
File
- src/
Plugin/ views/ field/ EntityFormField.php, line 29
Namespace
Drupal\views_entity_form_field\Plugin\views\fieldView source
class EntityFormField extends FieldPluginBase implements CacheableDependencyInterface, DependentWithRemovalPluginInterface {
use EntityTranslationRenderTrait;
use PluginDependencyTrait;
use UncacheableFieldHandlerTrait;
/**
* The entity field manager.
*
* @var \Drupal\Core\Entity\EntityFieldManagerInterface
*/
protected $entityFieldManager;
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* The entity type ID.
*
* @var string
*/
protected $entityTypeId;
/**
* The field type manager.
*
* @var \Drupal\Core\Field\FieldTypePluginManagerInterface
*/
protected $fieldTypeManager;
/**
* The field widget plugin manager.
*
* @var \Drupal\Core\Field\WidgetPluginManager
*/
protected $fieldWidgetManager;
/**
* The loaded field widgets.
*
* @var \Drupal\Core\Field\WidgetInterface[]
*/
protected $fieldWidgets;
/**
* The language manager.
*
* @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
/**
* Constructs a new EditQuantity object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin ID for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager
* The entity field manager.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
* @param \Drupal\Core\Field\WidgetPluginManager $field_widget_manager
* The field widget plugin manager.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityFieldManagerInterface $entity_field_manager, EntityTypeManagerInterface $entity_type_manager, WidgetPluginManager $field_widget_manager, LanguageManagerInterface $language_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityFieldManager = $entity_field_manager;
$this->entityTypeManager = $entity_type_manager;
$this->fieldWidgetManager = $field_widget_manager;
$this->languageManager = $language_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('entity_field.manager'), $container
->get('entity_type.manager'), $container
->get('plugin.manager.field.widget'), $container
->get('language_manager'));
}
/**
* Returns the entity type manager.
*
* @return \Drupal\Core\Entity\EntityTypeManagerInterface
* The entity type manager service.
*/
protected function getEntityTypeManager() {
return $this->entityTypeManager;
}
/**
* The field type plugin manager.
*
* This is loaded on-demand, since it's only needed during configuration.
*
* @return \Drupal\Core\Field\FieldTypePluginManagerInterface
* The field type plugin manager.
*/
protected function getFieldTypeManager() {
if (is_null($this->fieldTypeManager)) {
$this->fieldTypeManager = \Drupal::service('plugin.manager.field.field_type');
}
return $this->fieldTypeManager;
}
/**
* Get the entity type ID for this views field instance.
*
* @return string
* The entity type ID.
*/
protected function getEntityTypeId() {
if (is_null($this->entityTypeId)) {
$this->entityTypeId = $this
->getEntityType();
}
return $this->entityTypeId;
}
/**
* Collects the definition of field.
*
* @param string $bundle
* The bundle to load the field definition for.
*
* @return \Drupal\Core\Field\FieldDefinitionInterface|null
* The field definition. Null if not set.
*/
protected function getBundleFieldDefinition($bundle = NULL) {
$bundle = !is_null($bundle) ? $bundle : reset($this->definition['bundles']);
$field_definitions = $this->entityFieldManager
->getFieldDefinitions($this
->getEntityTypeId(), $bundle);
return array_key_exists($this->definition['field_name'], $field_definitions) ? $field_definitions[$this->definition['field_name']] : NULL;
}
/**
* Returns an array of applicable widget options for a field.
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
* The field definition.
*
* @return string[]
* An array of applicable widget options.
*/
protected function getPluginApplicableOptions(FieldDefinitionInterface $field_definition) {
$options = $this->fieldWidgetManager
->getOptions($field_definition
->getType());
$applicable_options = [];
foreach ($options as $option => $label) {
$plugin_class = DefaultFactory::getPluginClass($option, $this->fieldWidgetManager
->getDefinition($option));
if ($plugin_class::isApplicable($field_definition)) {
$applicable_options[$option] = $label;
}
}
return $applicable_options;
}
/**
* Returns the default field widget ID for a specific field type.
*
* @param string $field_type
* The field type ID.
*
* @return null|string
* The default field widget ID. Null otherwise.
*/
protected function getPluginDefaultOption($field_type) {
$definition = $this
->getFieldTypeManager()
->getDefinition($field_type, FALSE);
return $definition && isset($definition['default_widget']) ? $definition['default_widget'] : NULL;
}
/**
* Gets a bundle-specific field widget instance.
*
* @param null|string $bundle
* The bundle to load the plugin for.
*
* @return null|\Drupal\Core\Field\WidgetInterface
* The field widget plugin if it is set. Null otherwise.
*/
protected function getPluginInstance($bundle = NULL) {
// Cache the created instance per bundle.
$bundle = !is_null($bundle) ? $bundle : reset($this->definition['bundles']);
if (!isset($this->fieldWidgets[$bundle]) && ($field_definition = $this
->getBundleFieldDefinition($bundle))) {
// Compile options.
$options = [
'field_definition' => $field_definition,
'form_mode' => 'views_view',
'prepare' => FALSE,
'configuration' => $this->options['plugin'],
];
// Unset type if improperly set and set to prepare with default config.
if (isset($options['configuration']['type']) && empty($options['configuration']['type'])) {
unset($options['configuration']['type']);
$options['prepare'] = TRUE;
}
// Load field widget.
$this->fieldWidgets[$bundle] = $this->fieldWidgetManager
->getInstance($options);
}
return $this->fieldWidgets[$bundle];
}
/**
* {@inheritdoc}
*/
protected function getLanguageManager() {
return $this->languageManager;
}
/**
* {@inheritdoc}
*/
protected function getView() {
return $this->view;
}
/**
* {@inheritdoc}
*/
public function getCacheContexts() {
return Cache::mergeContexts($this
->getEntityTranslationRenderer()
->getCacheContexts(), [
'user',
]);
}
/**
* {@inheritdoc}
*/
public function getCacheMaxAge() {
return Cache::PERMANENT;
}
/**
* {@inheritdoc}
*/
public function getCacheTags() {
$field_definition = $this
->getBundleFieldDefinition();
$field_storage_definition = $field_definition
->getFieldStorageDefinition();
return Cache::mergeTags($field_definition instanceof CacheableDependencyInterface ? $field_definition
->getCacheTags() : [], $field_storage_definition instanceof CacheableDependencyInterface ? $field_storage_definition
->getCacheTags() : []);
}
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
$this->dependencies = parent::calculateDependencies();
// Add the module providing the configured field storage as a dependency.
if (($field_definition = $this
->getBundleFieldDefinition()) && $field_definition instanceof EntityInterface) {
$this->dependencies['config'][] = $field_definition
->getConfigDependencyName();
}
if (!empty($this->options['type'])) {
// Add the module providing the formatter.
$this->dependencies['module'][] = $this->fieldWidgetManager
->getDefinition($this->options['type'])['provider'];
// Add the formatter's dependencies.
if (($formatter = $this
->getPluginInstance()) && $formatter instanceof DependentPluginInterface) {
$this
->calculatePluginDependencies($formatter);
}
}
return $this->dependencies;
}
/**
* {@inheritdoc}
*/
public function onDependencyRemoval(array $dependencies) {
// See if this handler is responsible for any of the dependencies being
// removed. If this is the case, indicate that this handler needs to be
// removed from the View.
$remove = FALSE;
// Get all the current dependencies for this handler.
$current_dependencies = $this
->calculateDependencies();
foreach ($current_dependencies as $group => $dependency_list) {
// Check if any of the handler dependencies match the dependencies being
// removed.
foreach ($dependency_list as $config_key) {
if (isset($dependencies[$group]) && array_key_exists($config_key, $dependencies[$group])) {
// This handlers dependency matches a dependency being removed,
// indicate that this handler needs to be removed.
$remove = TRUE;
break 2;
}
}
}
return $remove;
}
/**
* {@inheritdoc}
*/
public function clickSortable() {
return FALSE;
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['plugin']['contains']['hide_title']['default'] = TRUE;
$options['plugin']['contains']['hide_description']['default'] = TRUE;
$options['plugin']['contains']['type']['default'] = [];
$options['plugin']['contains']['settings']['default'] = [];
$options['plugin']['contains']['third_party_settings']['default'] = [];
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$field_definition = $this
->getBundleFieldDefinition();
$form['plugin'] = [
'type' => [
'#type' => 'select',
'#title' => $this
->t('Widget type'),
'#options' => $this
->getPluginApplicableOptions($field_definition),
'#default_value' => $this->options['plugin']['type'],
'#attributes' => [
'class' => [
'field-plugin-type',
],
],
'#ajax' => [
'url' => views_ui_build_form_url($form_state),
],
'#submit' => [
[
$this,
'submitTemporaryForm',
],
],
'#executes_submit_callback' => TRUE,
],
'hide_title' => [
'#type' => 'checkbox',
'#title' => $this
->t('Hide widget title'),
'#default_value' => $this->options['plugin']['hide_title'],
],
'hide_description' => [
'#type' => 'checkbox',
'#title' => $this
->t('Hide widget description'),
'#default_value' => $this->options['plugin']['hide_description'],
],
'settings_edit_form' => [],
];
// Generate the settings form and allow other modules to alter it.
if ($plugin = $this
->getPluginInstance()) {
$settings_form = $plugin
->settingsForm($form, $form_state);
// Adds the widget third party settings forms.
$third_party_settings_form = [];
foreach ($this->moduleHandler
->getImplementations('field_widget_third_party_settings_form') as $module) {
$third_party_settings_form[$module] = $this->moduleHandler
->invoke($module, 'field_widget_third_party_settings_form', [
$plugin,
$field_definition,
'views_view',
$form,
$form_state,
]);
}
if ($settings_form || $third_party_settings_form) {
$form['plugin']['#cell_attributes'] = [
'colspan' => 3,
];
$form['plugin']['settings_edit_form'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Widget settings'),
'#attributes' => [
'class' => [
'field-plugin-settings-edit-form',
],
],
'settings' => $settings_form,
'third_party_settings' => $third_party_settings_form,
];
$form['#attributes']['class'][] = 'field-plugin-settings-editing';
}
}
}
/**
* {@inheritdoc}
*/
public function submitFormCalculateOptions(array $options, array $form_state_options) {
// When we change the formatter type we don't want to keep any of the
// previous configured formatter settings, as there might be schema
// conflict.
unset($options['settings']);
$options = $form_state_options + $options;
if (!isset($options['settings'])) {
$options['settings'] = [];
}
return $options;
}
/**
* {@inheritdoc}
*/
public function submitOptionsForm(&$form, FormStateInterface $form_state) {
parent::submitOptionsForm($form, $form_state);
$options =& $form_state
->getValue('options');
$options['plugin']['settings'] = isset($options['plugin']['settings_edit_form']['settings']) ? array_intersect_key($options['plugin']['settings_edit_form']['settings'], $this->fieldWidgetManager
->getDefaultSettings($options['plugin']['type'])) : [];
$options['plugin']['third_party_settings'] = isset($options['plugin']['settings_edit_form']['third_party_settings']) ? $options['plugin']['settings_edit_form']['third_party_settings'] : [];
unset($options['plugin']['settings_edit_form']);
}
/**
* {@inheritdoc}
*/
public function getValue(ResultRow $row, $field = NULL) {
return '<!--form-item-' . $this->options['id'] . '--' . $row->index . '-->';
}
/**
* Form constructor for the views form.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*/
public function viewsForm(array &$form, FormStateInterface $form_state) {
$field_name = $this->definition['field_name'];
// Initialize form values.
$form['#cache']['max-age'] = 0;
$form['#attached']['library'][] = 'views_entity_form_field/views_form';
$form['#attributes']['class'][] = 'views-entity-form';
$form['#process'][] = [
$this,
'viewsFormProcess',
];
$form['#tree'] = TRUE;
$form += [
'#parents' => [],
];
// Only add the buttons if there are results.
if (!empty($this
->getView()->result)) {
$form[$this->options['id']]['#tree'] = TRUE;
$form[$this->options['id']]['#entity_form_field'] = TRUE;
foreach ($this
->getView()->result as $row_index => $row) {
// Initialize this row and column.
$form[$this->options['id']][$row_index]['#parents'] = [
$this->options['id'],
$row_index,
];
$form[$this->options['id']][$row_index]['#tree'] = TRUE;
// Make sure there's an entity for this row (relationships can be null).
if ($this
->getEntity($row)) {
// Load field definition based on current entity bundle.
$entity = $this
->getEntityTranslation($this
->getEntity($row), $row);
if ($entity
->hasField($field_name) && $this
->getBundleFieldDefinition($entity
->bundle())
->isDisplayConfigurable('form')) {
$items = $entity
->get($field_name)
->filterEmptyItems();
// Add widget to form and add field overrides.
$form[$this->options['id']][$row_index][$field_name] = $this
->getPluginInstance()
->form($items, $form[$this->options['id']][$row_index], $form_state);
$form[$this->options['id']][$row_index][$field_name]['#access'] = $entity
->access('update') && $items
->access('edit');
$form[$this->options['id']][$row_index][$field_name]['#cache']['contexts'] = $entity
->getCacheContexts();
$form[$this->options['id']][$row_index][$field_name]['#cache']['tags'] = $entity
->getCacheTags();
$form[$this->options['id']][$row_index][$field_name]['#parents'] = [
$this->options['id'],
$row_index,
$field_name,
];
// Hide field widget title.
if ($this->options['plugin']['hide_title']) {
$form[$this->options['id']][$row_index][$field_name]['#attributes']['class'][] = 'views-entity-form-field-field-label-hidden';
}
// Hide field widget description.
if ($this->options['plugin']['hide_description']) {
$form[$this->options['id']][$row_index][$field_name]['#attributes']['class'][] = 'views-entity-form-field-field-description-hidden';
}
}
}
}
}
}
/**
* Processes the form, adding the submission handler to save the entities.
*
* @param array $element
* A nested array form elements comprising the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @return array
* The processed form element.
*/
public function viewsFormProcess(array $element, FormStateInterface $form_state) {
$element['#submit'][] = [
$this,
'saveEntities',
];
return $element;
}
/**
* {@inheritdoc}
*/
public function viewsFormValidate(array &$form, FormStateInterface $form_state) {
$form_state
->cleanValues();
$this
->buildEntities($form, $form_state, TRUE);
}
/**
* {@inheritdoc}
*/
public function viewsFormSubmit(array &$form, FormStateInterface $form_state) {
$form_state
->cleanValues();
$this
->buildEntities($form, $form_state);
}
/**
* Update entity objects based upon the submitted form values.
*
* @param array $form
* A nested array form elements comprising the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param bool $validate
* Validate the entity after extracting form values.
*/
protected function buildEntities(array &$form, FormStateInterface $form_state, $validate = FALSE) {
$field_name = $this->definition['field_name'];
// Set this value back to it's relevant entity from each row.
foreach ($this
->getView()->result as $row_index => $row) {
// Check to make sure that this entity has a relevant field.
$entity = $this
->getEntity($row);
if ($entity && $entity
->hasField($field_name) && $this
->getBundleFieldDefinition($entity
->bundle())
->isDisplayConfigurable('form')) {
// Get current entity field values.
$items = $entity
->get($field_name)
->filterEmptyItems();
// Extract values.
$this
->getPluginInstance($entity
->bundle())
->extractFormValues($items, $form[$this->options['id']][$row_index], $form_state);
// Validate entity and add violations to field widget.
if ($validate) {
$violations = $items
->validate();
if ($violations
->count() > 0) {
$this
->getPluginInstance($entity
->bundle())
->flagErrors($items, $violations, $form[$this->options['id']][$row_index], $form_state);
}
}
}
}
}
/**
* Save the view's entities.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*/
public function saveEntities(array &$form, FormStateInterface $form_state) {
// We only want to save the entity once per relationship.
if (is_null($form_state
->getTemporaryValue([
'saved_relationships',
$this->relationship,
]))) {
$storage = $this
->getEntityTypeManager()
->getStorage($this
->getEntityTypeId());
$rows_saved = [];
$rows_failed = [];
foreach ($this
->getView()->result as $row_index => $row) {
$entity = $this
->getEntity($row);
if ($entity) {
$entity = $this
->getEntityTranslation($entity, $row);
$original_entity = $this
->getEntityTranslation($storage
->loadUnchanged($entity
->id()), $row);
try {
if ($this
->entityShouldBeSaved($entity, $original_entity)) {
$storage
->save($entity);
$rows_saved[$row_index] = $entity
->label();
}
} catch (\Exception $exception) {
$rows_failed[$row_index] = $entity
->label();
}
}
}
// Let the user know how many entities were saved.
$messenger = \Drupal::messenger();
$entity_type_definition = $this->entityTypeManager
->getDefinition($this
->getEntityTypeId());
$messenger
->addStatus($this
->formatPlural(count($rows_saved), '@count @singular_label saved.', '@count @plural_label saved.', [
'@count' => count($rows_saved),
'@singular_label' => $entity_type_definition
->getSingularLabel(),
'@plural_label' => $entity_type_definition
->getPluralLabel(),
]));
// Let the user know which entities couldn't be saved.
if (count($rows_failed) > 0) {
$messenger
->addWarning($this
->formatPlural(count($rows_failed), '@count @singular_label failed to save: @labels', '@count @plural_label failed to save: @labels', [
'@count' => count($rows_failed),
'@singular_label' => $entity_type_definition
->getSingularLabel(),
'@plural_label' => $entity_type_definition
->getPluralLabel(),
'@labels' => implode(', ', $rows_failed),
]));
}
// Track that this relationship has been saved.
$form_state
->setTemporaryValue([
'saved_relationships',
$this->relationship,
], TRUE);
}
}
/**
* Determines if an entity should be saved.
*
* @param EntityInterface $entity
* The possibly modified entity in question.
* @param EntityInterface $original_entity
* The original unmodified entity.
*
* @return bool
* TRUE if the entity should be saved; FALSE otherwise.
*/
protected function entityShouldBeSaved(EntityInterface $entity, EntityInterface $original_entity) {
$save_entity = FALSE;
foreach ($entity as $field_name => $new_field) {
$original_field = $original_entity
->get($field_name);
if (!$new_field
->equals($original_field)) {
$save_entity = TRUE;
break;
}
}
return $save_entity;
}
/**
* {@inheritdoc}
*/
public function query() {
// Do nothing.
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
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 | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
DependencyTrait:: |
protected | property | The object's dependencies. | |
DependencyTrait:: |
protected | function | Adds multiple dependencies. | |
DependencyTrait:: |
protected | function | Adds a dependency. | |
EntityFormField:: |
protected | property | The entity field manager. | |
EntityFormField:: |
protected | property | The entity type ID. | |
EntityFormField:: |
protected | property | The entity type manager. | |
EntityFormField:: |
protected | property | The field type manager. | |
EntityFormField:: |
protected | property | The field widget plugin manager. | |
EntityFormField:: |
protected | property | The loaded field widgets. | |
EntityFormField:: |
protected | property | The language manager. | |
EntityFormField:: |
protected | function | Update entity objects based upon the submitted form values. | |
EntityFormField:: |
public | function |
Default options form that provides the label widget that all fields
should have. Overrides FieldPluginBase:: |
|
EntityFormField:: |
public | function |
Calculates dependencies for the configured plugin. Overrides HandlerBase:: |
|
EntityFormField:: |
public | function |
Determines if this field is click sortable. Overrides FieldPluginBase:: |
|
EntityFormField:: |
public static | function |
Creates an instance of the plugin. Overrides PluginBase:: |
|
EntityFormField:: |
protected | function |
Information about options for all kinds of purposes will be held here. Overrides FieldPluginBase:: |
|
EntityFormField:: |
protected | function | Determines if an entity should be saved. | |
EntityFormField:: |
protected | function | Collects the definition of field. | |
EntityFormField:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyInterface:: |
|
EntityFormField:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyInterface:: |
|
EntityFormField:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyInterface:: |
|
EntityFormField:: |
protected | function |
Get the entity type ID for this views field instance. Overrides EntityTranslationRenderTrait:: |
|
EntityFormField:: |
protected | function |
Returns the entity type manager. Overrides EntityTranslationRenderTrait:: |
|
EntityFormField:: |
protected | function | The field type plugin manager. | |
EntityFormField:: |
protected | function |
Returns the language manager. Overrides EntityTranslationRenderTrait:: |
|
EntityFormField:: |
protected | function | Returns an array of applicable widget options for a field. | |
EntityFormField:: |
protected | function | Returns the default field widget ID for a specific field type. | |
EntityFormField:: |
protected | function | Gets a bundle-specific field widget instance. | |
EntityFormField:: |
public | function |
Gets the value that's supposed to be rendered. Overrides UncacheableFieldHandlerTrait:: |
|
EntityFormField:: |
protected | function |
Returns the top object of a view. Overrides EntityTranslationRenderTrait:: |
|
EntityFormField:: |
public | function |
Allows a plugin to define whether it should be removed. Overrides DependentWithRemovalPluginInterface:: |
|
EntityFormField:: |
public | function |
Called to add the field to a query. Overrides FieldPluginBase:: |
|
EntityFormField:: |
public | function | Save the view's entities. | |
EntityFormField:: |
public | function |
Calculates options stored on the handler Overrides HandlerBase:: |
|
EntityFormField:: |
public | function |
Performs some cleanup tasks on the options array before saving it. Overrides FieldPluginBase:: |
|
EntityFormField:: |
public | function | Form constructor for the views form. | |
EntityFormField:: |
public | function | Processes the form, adding the submission handler to save the entities. | |
EntityFormField:: |
public | function | ||
EntityFormField:: |
public | function | ||
EntityFormField:: |
public | function |
Constructs a new EditQuantity object. Overrides HandlerBase:: |
|
EntityTranslationRenderTrait:: |
protected | property | The renderer to be used to render the entity row. | |
EntityTranslationRenderTrait:: |
protected | function | Returns the entity repository. | 7 |
EntityTranslationRenderTrait:: |
public | function | Returns the entity translation matching the configured row language. | |
EntityTranslationRenderTrait:: |
protected | function | Returns the current renderer. | |
FieldPluginBase:: |
public | property | Stores additional fields which get added to the query. | |
FieldPluginBase:: |
public | property | ||
FieldPluginBase:: |
public | property | ||
FieldPluginBase:: |
protected | property | Keeps track of the last render index. | |
FieldPluginBase:: |
protected | property | The link generator. | |
FieldPluginBase:: |
public | property | The field value prior to any rewriting. | |
FieldPluginBase:: |
protected | property |
Stores the render API renderer. Overrides PluginBase:: |
1 |
FieldPluginBase:: |
protected | function | Add 'additional' fields to the query. | |
FieldPluginBase:: |
protected | function | Add any special tokens this field might use for itself. | 4 |
FieldPluginBase:: |
public | function |
Return a string representing this handler's name in the UI. Overrides HandlerBase:: |
|
FieldPluginBase:: |
public | function |
Provide extra data to the administration form Overrides HandlerBase:: |
|
FieldPluginBase:: |
public | function |
Renders a field using advanced settings. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
protected | function | Determine if this field can allow advanced rendering. | |
FieldPluginBase:: |
public | function |
Adds an ORDER BY clause to the query for click sort columns. Overrides FieldHandlerInterface:: |
1 |
FieldPluginBase:: |
protected | function | Document any special tokens this field might use for itself. | 3 |
FieldPluginBase:: |
public | function |
Returns the class of the field. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
public | function |
Returns the class of the field's label. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
public | function |
Returns an HTML element for the label based upon the field's element type. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
public | function |
Returns an HTML element based upon the field's element type. Overrides FieldHandlerInterface:: |
1 |
FieldPluginBase:: |
public | function |
Returns the class of the field's wrapper. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
public | function |
Returns an HTML element for the wrapper based upon the field's element type. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
public | function |
Provides a list of elements valid for field HTML. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
public | function |
Gets the entity matching the current row and relationship. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
protected | function | Returns all field labels of fields before this field. | |
FieldPluginBase:: |
protected | function |
Returns the render API renderer. Overrides PluginBase:: |
|
FieldPluginBase:: |
public | function |
Gets the 'render' tokens to use for advanced rendering. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
protected | function | Recursive function to add replacements for nested query string parameters. | |
FieldPluginBase:: |
public | function |
Initialize the plugin. Overrides HandlerBase:: |
14 |
FieldPluginBase:: |
public | function |
Checks if a field value is empty. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
public | function |
Gets this field's label. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
protected | function | Gets the link generator. | |
FieldPluginBase:: |
public | function |
Runs before any fields are rendered. Overrides FieldHandlerInterface:: |
10 |
FieldPluginBase:: |
protected | function | Render this field as user-defined altered text. | |
FieldPluginBase:: |
protected | function | Render this field as a link, with the info from a fieldset set by the user. | |
FieldPluginBase:: |
public | function |
Performs an advanced text render for the item. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
protected | function | Trims the field down to the specified length. | |
FieldPluginBase:: |
constant | Indicator of the renderText() method for rendering the whole element. (if no render_item() method is available). | ||
FieldPluginBase:: |
constant | Indicator of the renderText() method for rendering the empty text. | ||
FieldPluginBase:: |
constant | Indicator of the renderText() method for rendering a single item. (If no render_item() is present). | ||
FieldPluginBase:: |
public | function |
Passes values to drupal_render() using $this->themeFunctions() as #theme. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
public | function |
Provide a full list of possible theme templates used by this style. Overrides PluginBase:: |
|
FieldPluginBase:: |
public | function |
Replaces a value with tokens from the last field. Overrides FieldHandlerInterface:: |
|
FieldPluginBase:: |
public static | function | Trims the field down to the specified length. | |
FieldPluginBase:: |
public | function |
Determines if this field will be available as an option to group the result
by in the style settings. Overrides FieldHandlerInterface:: |
|
HandlerBase:: |
public | property | With field you can override the realField if the real field is not set. | |
HandlerBase:: |
protected | property | The module handler. | 3 |
HandlerBase:: |
public | property | Where the $query object will reside: | 7 |
HandlerBase:: |
public | property | The actual field in the database table, maybe different on other kind of query plugins/special handlers. | |
HandlerBase:: |
public | property | The relationship used for this field. | |
HandlerBase:: |
public | property | The table this handler is attached to. | |
HandlerBase:: |
public | property | The alias of the table of this handler which is used in the query. | |
HandlerBase:: |
protected | property | The views data service. | |
HandlerBase:: |
public | function | Take input from exposed handlers and assign to this handler, if necessary. | 1 |
HandlerBase:: |
public | function |
Check whether given user has access to this handler. Overrides ViewsHandlerInterface:: |
4 |
HandlerBase:: |
public static | function |
Breaks x,y,z and x+y+z into an array. Overrides ViewsHandlerInterface:: |
|
HandlerBase:: |
public | function |
Determines if the handler is considered 'broken', meaning it's a
placeholder used when a handler can't be found. Overrides ViewsHandlerInterface:: |
|
HandlerBase:: |
public | function | Render our chunk of the exposed handler form when selecting | 1 |
HandlerBase:: |
public | function | Form for exposed handler options. | 2 |
HandlerBase:: |
public | function | Provide a form for setting options. | 1 |
HandlerBase:: |
public | function | Provide a form for aggregation settings. | 1 |
HandlerBase:: |
public | function | Determine if a handler can be exposed. | 2 |
HandlerBase:: |
protected | function | Transform a string by a certain method. | |
HandlerBase:: |
public | function | Set new exposed option defaults when exposed setting is flipped on. | 2 |
HandlerBase:: |
public | function | Provide defaults for the handler. | |
HandlerBase:: |
public | function | Displays the Expose form. | |
HandlerBase:: |
public | function |
Ensure the main table for this handler is in the query. This is used
a lot. Overrides ViewsHandlerInterface:: |
2 |
HandlerBase:: |
public | function | Get information about the exposed form for the form renderer. | 1 |
HandlerBase:: |
public | function | Creates cross-database SQL dates. | 2 |
HandlerBase:: |
public | function | Creates cross-database SQL date formatting. | 2 |
HandlerBase:: |
public | function |
Determines the entity type used by this handler. Overrides ViewsHandlerInterface:: |
|
HandlerBase:: |
public | function |
Shortcut to get a handler's raw field value. Overrides ViewsHandlerInterface:: |
|
HandlerBase:: |
public | function |
Get the join object that should be used for this handler. Overrides ViewsHandlerInterface:: |
|
HandlerBase:: |
protected | function | Gets the module handler. | |
HandlerBase:: |
public static | function |
Fetches a handler to join one table to a primary table from the data cache. Overrides ViewsHandlerInterface:: |
|
HandlerBase:: |
protected | function | Gets views data service. | |
HandlerBase:: |
public | function | If a handler has 'extra options' it will get a little settings widget and another form called extra_options. | 1 |
HandlerBase:: |
public | function | Returns TRUE if the exposed filter works like a grouped filter. | 1 |
HandlerBase:: |
public | function | Determine if this item is 'exposed', meaning it provides form elements to let users modify the view. | |
HandlerBase:: |
public | function | Define if the exposed input has to be submitted multiple times. This is TRUE when exposed filters grouped are using checkboxes as widgets. | 1 |
HandlerBase:: |
protected | function | Provides a unique placeholders for handlers. | |
HandlerBase:: |
public | function |
Run after the view is executed, before the result is cached. Overrides ViewsHandlerInterface:: |
|
HandlerBase:: |
public | function |
Run before the view is built. Overrides ViewsHandlerInterface:: |
2 |
HandlerBase:: |
public | function |
Sanitize the value for output. Overrides ViewsHandlerInterface:: |
|
HandlerBase:: |
public | function | Sets the module handler. | |
HandlerBase:: |
public | function |
Called just prior to query(), this lets a handler set up any relationship
it needs. Overrides ViewsHandlerInterface:: |
|
HandlerBase:: |
public | function | ||
HandlerBase:: |
public | function | Shortcut to display the expose/hide button. | 2 |
HandlerBase:: |
public | function |
Shortcut to display the exposed options form. Overrides ViewsHandlerInterface:: |
|
HandlerBase:: |
public | function | If set to remember exposed input in the session, store it there. | 1 |
HandlerBase:: |
public | function | Submit the exposed handler form | |
HandlerBase:: |
public | function | Perform any necessary changes to the form exposes prior to storage. There is no need for this function to actually store the data. | |
HandlerBase:: |
public | function | Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data. | |
HandlerBase:: |
public | function | Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data. | 1 |
HandlerBase:: |
public | function | A submit handler that is used for storing temporary items when using multi-step changes, such as ajax requests. | |
HandlerBase:: |
public | function | Provides the handler some groupby. | 13 |
HandlerBase:: |
public | function |
Validate that the plugin is correct and can be saved. Overrides PluginBase:: |
2 |
HandlerBase:: |
public | function | Validate the exposed handler form | 4 |
HandlerBase:: |
public | function | Validate the options form. | 1 |
HandlerBase:: |
public | function | Validate the options form. | |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
public | property | Plugins's definition | |
PluginBase:: |
public | property | The display object this plugin is for. | |
PluginBase:: |
public | property | Options for this plugin will be held here. | |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
protected | property | Denotes whether the plugin has an additional options form. | 8 |
PluginBase:: |
public | property | The top object of a view. | 1 |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Clears a plugin. Overrides ViewsPluginInterface:: |
2 |
PluginBase:: |
protected | function | Do the work to filter out stored options depending on the defined options. | |
PluginBase:: |
public | function |
Filter out stored options depending on the defined options. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public | function |
Returns an array of available token replacements. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function |
Returns the plugin provider. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public | function |
Adds elements for available core tokens to a form. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public | function |
Returns a string with any core tokens replaced. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
constant | Include entity row languages when listing languages. | ||
PluginBase:: |
constant | Include negotiated languages when listing languages. | ||
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
protected | function | Makes an array of languages, optionally including special languages. | |
PluginBase:: |
public | function |
Return the human readable name of the display. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public static | function |
Moves form elements into fieldsets for presentation purposes. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public static | function |
Flattens the structure of form elements. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public static | function | Returns substitutions for Views queries for languages. | |
PluginBase:: |
protected | function | Fills up the options of the plugin with defaults. | |
PluginBase:: |
public | function |
Returns the summary of the settings in the display. Overrides ViewsPluginInterface:: |
6 |
PluginBase:: |
public static | function |
Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface:: |
6 |
PluginBase:: |
public | function |
Unpack options over our existing defaults, drilling down into arrays
so that defaults don't get totally blown away. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public | function |
Returns the usesOptions property. Overrides ViewsPluginInterface:: |
8 |
PluginBase:: |
public | function |
Validate the options form. Overrides ViewsPluginInterface:: |
15 |
PluginBase:: |
protected | function | Replaces Views' tokens in a given string. The resulting string will be sanitized with Xss::filterAdmin. | 1 |
PluginBase:: |
constant | Query string to indicate the site default language. | ||
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 |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
TrustedCallbackInterface:: |
constant | Untrusted callbacks throw exceptions. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger silenced E_USER_DEPRECATION errors. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger E_USER_WARNING errors. | ||
UncacheableFieldHandlerTrait:: |
protected | function | Actually renders the field markup. | |
UncacheableFieldHandlerTrait:: |
abstract protected | function | ||
UncacheableFieldHandlerTrait:: |
public | function | ||
UncacheableFieldHandlerTrait:: |
public | function |