You are here

class GridStackMediaFormatter in GridStack 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/GridStackMediaFormatter.php \Drupal\gridstack\Plugin\Field\FieldFormatter\GridStackMediaFormatter

Plugin implementation of the 'GridStack Media' formatter.

Hierarchy

Expanded class hierarchy of GridStackMediaFormatter

File

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

Namespace

Drupal\gridstack\Plugin\Field\FieldFormatter
View source
class GridStackMediaFormatter 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
GridStackEntityFormatterBase::$loggerFactory protected property The logger factory.
GridStackEntityFormatterBase::blazyManager public function Returns the blazy manager.
GridStackEntityFormatterBase::buildSettings public function Builds the settings.
GridStackEntityFormatterBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create
GridStackEntityFormatterBase::defaultSettings public static function
GridStackEntityFormatterBase::getScopedFormElements public function
GridStackEntityFormatterBase::viewElements public function
GridStackEntityFormatterBase::__construct public function Constructs a GridStackMediaFormatter instance.
GridStackFormatterTrait::$formatter protected property The gridstack field formatter manager.
GridStackFormatterTrait::$manager protected property The gridstack field formatter manager.
GridStackFormatterTrait::admin public function Returns the gridstack admin service shortcut.
GridStackFormatterTrait::formatter public function Returns the gridstack field formatter service.
GridStackFormatterTrait::manager public function Returns the gridstack service.
GridStackFormatterTrait::settingsSummary public function
GridStackMediaFormatter::isApplicable public static function Overrides GridStackFormatterTrait::isApplicable