GridStackMediaFormatter.php in GridStack 8
File
src/Plugin/Field/FieldFormatter/GridStackMediaFormatter.php
View source
<?php
namespace Drupal\gridstack\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FieldDefinitionInterface;
class GridStackMediaFormatter extends GridStackEntityFormatterBase {
public static function isApplicable(FieldDefinitionInterface $field_definition) {
$storage = $field_definition
->getFieldStorageDefinition();
return $storage
->isMultiple() && $storage
->getSetting('target_type') === 'media';
}
}