You are here

public function GridStackFormatterTrait::getCommonFieldDefinition in GridStack 8.2

Defines the common scope for both front and admin.

2 calls to GridStackFormatterTrait::getCommonFieldDefinition()
GridStackFormatterTrait::buildSettings in src/Plugin/Field/FieldFormatter/GridStackFormatterTrait.php
Builds the settings.
GridStackFormatterTrait::getCommonScopedFormElements in src/Plugin/Field/FieldFormatter/GridStackFormatterTrait.php
Defines the common scope for the form elements.

File

src/Plugin/Field/FieldFormatter/GridStackFormatterTrait.php, line 109

Class

GridStackFormatterTrait
A Trait common for gridstack formatters.

Namespace

Drupal\gridstack\Plugin\Field\FieldFormatter

Code

public function getCommonFieldDefinition() {
  $field = $this->fieldDefinition;
  return [
    'namespace' => 'gridstack',
    'current_view_mode' => $this->viewMode,
    'field_name' => $field
      ->getName(),
    'field_type' => $field
      ->getType(),
    'entity_type' => $field
      ->getTargetEntityTypeId(),
    'plugin_id' => $this
      ->getPluginId(),
    'target_type' => $this
      ->getFieldSetting('target_type'),
    'style' => FALSE,
    'grid_form' => FALSE,
  ];
}