You are here

trait SlickFormatterTrait in Slick Carousel 8

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

A Trait common for slick formatters.

Hierarchy

File

src/Plugin/Field/FieldFormatter/SlickFormatterTrait.php, line 10

Namespace

Drupal\slick\Plugin\Field\FieldFormatter
View source
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();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
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