You are here

abstract class SlickEntityReferenceFormatterBase in Slick Carousel 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/SlickEntityReferenceFormatterBase.php \Drupal\slick\Plugin\Field\FieldFormatter\SlickEntityReferenceFormatterBase
  2. 7.3 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

See also

\Drupal\slick_media\Plugin\Field\FieldFormatter

\Drupal\slick_paragraphs\Plugin\Field\FieldFormatter

File

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

Namespace

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

  /**
   * The logger factory.
   *
   * @var \Drupal\Core\Logger\LoggerChannelFactoryInterface
   */
  protected $loggerFactory;

  /**
   * The image style entity storage.
   *
   * @var \Drupal\Core\Entity\EntityStorageInterface
   */
  protected $imageStyleStorage;

  /**
   * Constructs a SlickMediaFormatter instance.
   */
  public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, LoggerChannelFactoryInterface $logger_factory, EntityStorageInterface $image_style_storage, SlickFormatterInterface $formatter, SlickManagerInterface $manager) {
    parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
    $this->loggerFactory = $logger_factory;
    $this->imageStyleStorage = $image_style_storage;
    $this->formatter = $formatter;
    $this->manager = $manager;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($plugin_id, $plugin_definition, $configuration['field_definition'], $configuration['settings'], $configuration['label'], $configuration['view_mode'], $configuration['third_party_settings'], $container
      ->get('logger.factory'), $container
      ->get('entity.manager')
      ->getStorage('image_style'), $container
      ->get('slick.formatter'), $container
      ->get('slick.manager'));
  }

  /**
   * {@inheritdoc}
   */
  public function getScopedFormElements() {
    return [
      'namespace' => 'slick',
    ] + parent::getScopedFormElements();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SlickEntityReferenceFormatterBase::$imageStyleStorage protected property The image style entity storage.
SlickEntityReferenceFormatterBase::$loggerFactory protected property The logger factory.
SlickEntityReferenceFormatterBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create
SlickEntityReferenceFormatterBase::getScopedFormElements public function
SlickEntityReferenceFormatterBase::__construct public function Constructs a SlickMediaFormatter instance.
SlickFormatterTrait::$formatter protected property The slick field formatter manager.
SlickFormatterTrait::$manager protected property The slick field formatter manager.
SlickFormatterTrait::admin public function Returns the slick admin service shortcut.
SlickFormatterTrait::formatter public function Returns the slick field formatter service.
SlickFormatterTrait::isApplicable public static function 1
SlickFormatterTrait::manager public function Returns the slick service.
SlickFormatterTrait::settingsSummary public function