function MediaLibraryOpenerInterface::getSelectionResponse

Same name in other branches
  1. 9 core/modules/media_library/src/MediaLibraryOpenerInterface.php \Drupal\media_library\MediaLibraryOpenerInterface::getSelectionResponse()
  2. 8.9.x core/modules/media_library/src/MediaLibraryOpenerInterface.php \Drupal\media_library\MediaLibraryOpenerInterface::getSelectionResponse()
  3. 10 core/modules/media_library/src/MediaLibraryOpenerInterface.php \Drupal\media_library\MediaLibraryOpenerInterface::getSelectionResponse()

Generates a response after selecting media items in the media library.

Parameters

\Drupal\media_library\MediaLibraryState $state: The state the media library was in at the time of selection, allowing the response to be customized based on that state.

int[] $selected_ids: The IDs of the selected media items.

Return value

\Drupal\Core\Ajax\AjaxResponse The response to update the page after selecting media.

2 methods override MediaLibraryOpenerInterface::getSelectionResponse()
MediaLibraryEditorOpener::getSelectionResponse in core/modules/media_library/src/MediaLibraryEditorOpener.php
Generates a response after selecting media items in the media library.
MediaLibraryFieldWidgetOpener::getSelectionResponse in core/modules/media_library/src/MediaLibraryFieldWidgetOpener.php
Generates a response after selecting media items in the media library.

File

core/modules/media_library/src/MediaLibraryOpenerInterface.php, line 51

Class

MediaLibraryOpenerInterface
Defines an interface for media library openers.

Namespace

Drupal\media_library

Code

public function getSelectionResponse(MediaLibraryState $state, array $selected_ids);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.