You are here

public function BlazyFormatterTrait::getCommonFieldDefinition in Blazy 8.2

Defines the common scope for both front and admin.

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

File

src/Plugin/Field/FieldFormatter/BlazyFormatterTrait.php, line 92

Class

BlazyFormatterTrait
A Trait common for all blazy formatters.

Namespace

Drupal\blazy\Plugin\Field\FieldFormatter

Code

public function getCommonFieldDefinition() {
  $field = $this->fieldDefinition;
  return [
    'namespace' => 'blazy',
    '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'),
  ];
}