You are here

protected function FormatterBase::setupFieldVariables in Blazy 7

Setup common variables across different hooks.

3 calls to FormatterBase::setupFieldVariables()
FormatterBase::buildSettingsForm in src/Plugin/Field/FieldFormatter/FormatterBase.php
Implements hook_field_formatter_settings_form().
FormatterBase::buildSettingsSummary in src/Plugin/Field/FieldFormatter/FormatterBase.php
FormatterBase::view in src/Plugin/Field/FieldFormatter/FormatterBase.php
Implements hook_field_formatter_view().

File

src/Plugin/Field/FieldFormatter/FormatterBase.php, line 235

Class

FormatterBase
Base class for blazy/slick image, and file formatters.

Namespace

Drupal\blazy\Plugin\Field\FieldFormatter

Code

protected function setupFieldVariables() {
  $settings = $this->fieldDisplay['settings'];

  // The actual formatter settings for database, and summaries.
  $this
    ->setSettings($settings);

  // Additional settings for the formatters and forms to work with.
  $settings['bundle'] = $this->bundle;
  $settings['field_name'] = $this->fieldName;
  $settings['entity_type_id'] = $this->entityType;
  $settings['field_type'] = $this->fieldType;
  $settings['multiple'] = $this->isMultiple;
  $settings['target_type'] = $this->targetType;
  $settings['plugin_id'] = $this->fieldDisplay['type'];
  return $settings;
}