MediaLibraryOpenerInterface
interface MediaLibraryOpenerInterface (View source)
Defines an interface for media library openers.
Media library opener services allow modules to check access to the media library selection dialog and respond to selections. Example use cases that require different handling:
- when used in an entity reference field widget;
- when used in a text editor.
Openers that require additional parameters or metadata should retrieve them from the MediaLibraryState object.
Methods
getSelectionResponse(MediaLibraryState $state, array $selected_ids)
Generates a response after selecting media items in the media library.
Details
AccessResultInterface
checkAccess(MediaLibraryState $state, AccountInterface $account)
Checks media library access.
AjaxResponse
getSelectionResponse(MediaLibraryState $state, array $selected_ids)
Generates a response after selecting media items in the media library.