You are here

protected function MediaForm::getFieldDefinitions in GridStack 8.2

Gets the definitions of the fields that are candidate for display.

2 calls to MediaForm::getFieldDefinitions()
MediaForm::getFieldData in src/Plugin/gridstack/stylizer/MediaForm.php
Returns available field media data.
MediaForm::getFieldDefinition in src/Plugin/gridstack/stylizer/MediaForm.php
Returns available field media definition.

File

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

Class

MediaForm
Provides the media form for Layout Builder integration.

Namespace

Drupal\gridstack\Plugin\gridstack\stylizer

Code

protected function getFieldDefinitions() {
  if (!isset($this->fieldDefinitions)) {
    if ($this
      ->getEntity()) {
      $this->fieldDefinitions = $this
        ->getEntity()
        ->getFieldDefinitions();
    }
    else {
      $this->fieldDefinitions = empty($this->bundle) ? [] : \Drupal::service('entity_field.manager')
        ->getFieldDefinitions($this->targetEntityType, $this->bundle);
    }
  }
  return $this->fieldDefinitions;
}