You are here

class GridStackEntityFormatter in GridStack 8.2

Plugin implementation of the 'GridStack Entity' formatter.

Plugin annotation


@FieldFormatter(
  id = "gridstack_entity",
  label = @Translation("GridStack Entity"),
  description = @Translation("Display the entity reference as a GridStack."),
  field_types = {"entity_reference"},
  quickedit = {"editor" = "disabled"}
)

Hierarchy

Expanded class hierarchy of GridStackEntityFormatter

File

src/Plugin/Field/FieldFormatter/GridStackEntityFormatter.php, line 18

Namespace

Drupal\gridstack\Plugin\Field\FieldFormatter
View source
class GridStackEntityFormatter extends GridStackEntityFormatterBase {

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

}

Members

Namesort descending Modifiers Type Description Overrides
GridStackEntityFormatter::isApplicable public static function Overrides GridStackFormatterTrait::isApplicable
GridStackEntityFormatterBase::buildElement public function
GridStackEntityFormatterBase::buildSettings public function Builds the settings.
GridStackEntityFormatterBase::create public static function
GridStackEntityFormatterBase::defaultSettings public static function
GridStackEntityFormatterBase::getScopedFormElements public function
GridStackEntityFormatterBase::viewElements public function
GridStackFormatterTrait::$formatter protected property The gridstack field formatter manager.
GridStackFormatterTrait::$loggerFactory protected property The logger factory.
GridStackFormatterTrait::$manager protected property The gridstack field formatter manager.
GridStackFormatterTrait::admin public function Returns the gridstack admin service shortcut.
GridStackFormatterTrait::blazyManager public function Overrides the blazy manager.
GridStackFormatterTrait::buildSettings public function Builds the settings. Aliased as: traitBuildSettings
GridStackFormatterTrait::formatter public function Returns the gridstack field formatter service.
GridStackFormatterTrait::getCommonFieldDefinition public function Defines the common scope for both front and admin.
GridStackFormatterTrait::getCommonScopedFormElements public function Defines the common scope for the form elements.
GridStackFormatterTrait::injectServices protected static function Injects DI services.
GridStackFormatterTrait::manager public function Returns the gridstack service.
GridStackFormatterTrait::settingsSummary public function
GridStackFormatterViewTrait::commonViewElements public function Returns similar view elements.