class UpdateSelectionCommand implements CommandInterface (View source)

internal  This is an internal part of Media Library and may be subject to change in minor releases. External code should not instantiate or extend this class.
 

AJAX command for adding media items to the media library selection.

This command instructs the client to add the given media item IDs to the current selection of the media library stored in Drupal.MediaLibrary.currentSelection.

This command is implemented by Drupal.AjaxCommands.prototype.updateMediaLibrarySelection() defined in media_library.ui.js.

Properties

protected int[] $mediaIds

An array of media IDs to add to the current selection.

Methods

__construct(array $media_ids)

Constructs an UpdateSelectionCommand object.

render()

Return an array to be run through json_encode and sent to the client.

Details

__construct(array $media_ids)

Constructs an UpdateSelectionCommand object.

Parameters

array $media_ids

An array of media IDs to add to the current selection.

render()

Return an array to be run through json_encode and sent to the client.