You are here

public function MediaLibraryGutenbergOpener::getSelectionResponse in Gutenberg 8

Same name and namespace in other branches
  1. 8.2 src/MediaLibraryGutenbergOpener.php \Drupal\gutenberg\MediaLibraryGutenbergOpener::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.

Overrides MediaLibraryOpenerInterface::getSelectionResponse

File

src/MediaLibraryGutenbergOpener.php, line 28

Class

MediaLibraryGutenbergOpener
The media library opener for Gutenberg editor.

Namespace

Drupal\gutenberg

Code

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

  // This is not being triggered by Gutenberg and it's handled on React side,
  // but we need to implement the interface, so we just return an empty AJAX
  // response.
  return new AjaxResponse();
}