You are here

abstract class SlickEntityReferenceFormatterBase in Slick Carousel 7.3

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/SlickEntityReferenceFormatterBase.php \Drupal\slick\Plugin\Field\FieldFormatter\SlickEntityReferenceFormatterBase
  2. 8 src/Plugin/Field/FieldFormatter/SlickEntityReferenceFormatterBase.php \Drupal\slick\Plugin\Field\FieldFormatter\SlickEntityReferenceFormatterBase

Base class for slick entity reference formatters with field details.

Hierarchy

Expanded class hierarchy of SlickEntityReferenceFormatterBase

File

src/Plugin/Field/FieldFormatter/SlickEntityReferenceFormatterBase.php, line 13

Namespace

Drupal\slick\Plugin\Field\FieldFormatter
View source
abstract class SlickEntityReferenceFormatterBase extends BlazyEntityReferenceBase {
  use SlickFormatterTrait;

  /**
   * {@inheritdoc}
   */
  public static function defaultSettings() {
    return SlickDefault::extendedSettings() + parent::defaultSettings();
  }

  /**
   * Constructs a SlickEntityReferenceFormatter instance.
   */
  public function __construct($plugin_id, $field, $instance, SlickFormatterInterface $formatter, SlickManagerInterface $manager) {
    parent::__construct($plugin_id, $field, $instance);
    $this->formatter = $formatter;
    $this->manager = $manager;
  }

  /**
   * {@inheritdoc}
   */
  public function getScopedFormElements() {
    $scopes = parent::getScopedFormElements();
    return [
      'nav' => TRUE,
      'layouts' => $this->stringOptions,
      'thumb_captions' => $this->textOptions,
      'thumb_positions' => TRUE,
      'use_view_mode' => TRUE,
      'vanilla' => TRUE,
    ] + $scopes;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BlazyEntityBase::$blazyEntity protected property The blazy entity instance.
BlazyEntityBase::blazyEntity public function Returns the blazy entity object.
BlazyEntityBase::buildElements public function Returns media contents.
BlazyEntityBase::getEntitiesToView protected function Converts $items array to object for easy D8 -> D7 backports. Overrides BlazyFormatterBase::getEntitiesToView
BlazyEntityReferenceBase::$linkOptions protected property The link options.
BlazyEntityReferenceBase::$stringOptions protected property The string options.
BlazyEntityReferenceBase::$textOptions protected property The text options.
BlazyEntityReferenceBase::buildElement public function Build individual item contents. Overrides BlazyEntityBase::buildElement
BlazyEntityReferenceBase::buildSettings public function Builds the settings. Overrides FormatterBase::buildSettings
BlazyEntityReferenceBase::getCaption public function Builds slide captions with possible multi-value fields.
BlazyEntityReferenceBase::getRequiredForms public function Returns required form elements for the current formatter. Overrides BlazyFormatterBase::getRequiredForms
BlazyEntityReferenceBase::settingsForm public function Implements hook_field_formatter_settings_form(). Overrides BlazyEntityBase::settingsForm
BlazyFormatterTrait::$formatter protected property The blazy-related formatter service.
BlazyFormatterTrait::$manager protected property The blazy field formatter manager.
BlazyFormatterTrait::formatter public function Returns the blazy-related formatter.
BlazyFormatterTrait::manager public function Returns the blazy service.
BlazyFormatterTrait::settingsSummary public function
FormatterBase::$admin protected property The blazy-related admin formatter service.
FormatterBase::$defaultSettingsMerged protected property Whether default settings have been merged into the current $settings.
FormatterBase::$fieldDefinition protected property The field definition.
FormatterBase::$fieldDisplay protected property The field display.
FormatterBase::$fieldInstance protected property The field instance.
FormatterBase::$htmlSettings protected property The form settings.
FormatterBase::$isMultiple protected property True if the field cardinality equals -1.
FormatterBase::$knownEntities protected property The known hard-coded entities.
FormatterBase::$langcode protected property The langcode.
FormatterBase::$pluginId protected property The blazy formatter plugin id.
FormatterBase::$settings protected property The formatter settings.
FormatterBase::$viewMode protected property The view mode.
FormatterBase::buildSettingsForm public function Implements hook_field_formatter_settings_form().
FormatterBase::buildSettingsSummary public function
FormatterBase::getHtmlSettings public function Gets html settings.
FormatterBase::getPluginId public function Gets formatter plugin id.
FormatterBase::getSetting public function
FormatterBase::getSettings public function Gets formatter settings.
FormatterBase::mergeDefaults protected function Merges default settings values into $settings.
FormatterBase::setHtmlSettings public function Sets html settings.
FormatterBase::setSetting public function
FormatterBase::setSettings public function Sets formatter settings.
FormatterBase::setupFieldVariables protected function Setup common variables across different hooks.
FormatterBase::view public function Implements hook_field_formatter_view().
SlickEntityReferenceFormatterBase::defaultSettings public static function Returns default settings. Overrides BlazyEntityReferenceBase::defaultSettings
SlickEntityReferenceFormatterBase::getScopedFormElements public function Defines the scope for the form elements. Overrides BlazyEntityReferenceBase::getScopedFormElements
SlickEntityReferenceFormatterBase::__construct public function Constructs a SlickEntityReferenceFormatter instance. Overrides FormatterBase::__construct
SlickFormatterTrait::admin public function Returns the slick admin service.
SlickFormatterTrait::viewElements public function 1