You are here

GridStackParagraphsFormatter.php in GridStack 8

Same filename and directory in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/GridStackParagraphsFormatter.php

File

src/Plugin/Field/FieldFormatter/GridStackParagraphsFormatter.php
View source
<?php

namespace Drupal\gridstack\Plugin\Field\FieldFormatter;

use Drupal\Core\Field\FieldDefinitionInterface;

/**
 * Plugin implementation of the 'GridStack Paragraphs' formatter.
 */
class GridStackParagraphsFormatter extends GridStackEntityFormatterBase {

  /**
   * {@inheritdoc}
   */
  public static function isApplicable(FieldDefinitionInterface $field_definition) {
    $storage = $field_definition
      ->getFieldStorageDefinition();
    return $storage
      ->isMultiple() && $storage
      ->getSetting('target_type') === 'paragraph';
  }

}

Classes

Namesort descending Description
GridStackParagraphsFormatter Plugin implementation of the 'GridStack Paragraphs' formatter.