SlickFormatterTrait.php in Slick Carousel 8
Same filename and directory in other branches
Namespace
Drupal\slick\Plugin\Field\FieldFormatterFile
src/Plugin/Field/FieldFormatter/SlickFormatterTrait.phpView source
<?php
namespace Drupal\slick\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FieldDefinitionInterface;
/**
* A Trait common for slick formatters.
*/
trait SlickFormatterTrait {
/**
* The slick field formatter manager.
*
* @var \Drupal\slick\SlickFormatterInterface
*/
protected $formatter;
/**
* The slick field formatter manager.
*
* @var \Drupal\slick\SlickManagerInterface
*/
protected $manager;
/**
* Returns the slick field formatter service.
*/
public function formatter() {
return $this->formatter;
}
/**
* Returns the slick service.
*/
public function manager() {
return $this->manager;
}
/**
* Returns the slick admin service shortcut.
*/
public function admin() {
return \Drupal::service('slick.admin');
}
/**
* {@inheritdoc}
*/
public function settingsSummary() {
// @todo: Remove second param post Blazy RC2+.
return $this
->admin()
->getSettingsSummary($this
->getScopedFormElements(), $this);
}
/**
* {@inheritdoc}
*/
public static function isApplicable(FieldDefinitionInterface $field_definition) {
return $field_definition
->getFieldStorageDefinition()
->isMultiple();
}
}
Traits
Name | Description |
---|---|
SlickFormatterTrait | A Trait common for slick formatters. |