You are here

public function MediaLibrary::getInfo in Media Library Form API Element 2.x

Same name and namespace in other branches
  1. 8 src/Element/MediaLibrary.php \Drupal\media_library_form_element\Element\MediaLibrary::getInfo()

Returns the element properties for this element.

Return value

array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format.

Overrides ElementInterface::getInfo

File

src/Element/MediaLibrary.php, line 556

Class

MediaLibrary
Provides a Media library form element.

Namespace

Drupal\media_library_form_element\Element

Code

public function getInfo() {
  $class = get_class($this);
  return [
    '#input' => TRUE,
    '#tree' => TRUE,
    '#cardinality' => 1,
    '#allowed_bundles' => [],
    '#process' => [
      [
        $class,
        'processAjaxForm',
      ],
      [
        $class,
        'processMediaLibrary',
      ],
      [
        $class,
        'processGroup',
      ],
    ],
    '#pre_render' => [
      [
        $class,
        'preRenderGroup',
      ],
    ],
    '#element_validate' => [
      [
        $class,
        'elementValidateMediaLibrary',
      ],
    ],
    '#theme' => 'media_library_element',
  ];
}