You are here

public function MediaForm::getFieldDefinition in GridStack 8.2

Returns available field media definition.

1 call to MediaForm::getFieldDefinition()
MediaForm::getFieldCardinality in src/Plugin/gridstack/stylizer/MediaForm.php
Returns available field media definition.

File

src/Plugin/gridstack/stylizer/MediaForm.php, line 103

Class

MediaForm
Provides the media form for Layout Builder integration.

Namespace

Drupal\gridstack\Plugin\gridstack\stylizer

Code

public function getFieldDefinition($name = '') {
  if (!isset($this->fieldDefinition)) {
    $this
      ->setFieldName($name);
    if ($definitions = $this
      ->getFieldDefinitions()) {
      $this->fieldDefinition = isset($definitions[$name]) ? $definitions[$name] : [];
    }
    else {
      $this->fieldDefinition = $this
        ->getFieldData($name);
    }
  }
  return $this->fieldDefinition;
}