class MediaLibraryFieldWidgetOpener implements MediaLibraryOpenerInterface (View source)

internal  This service is an internal part of Media Library's field widget.
 

The media library opener for field widgets.

Properties

protected EntityTypeManagerInterface $entityTypeManager

The entity type manager.

Methods

__construct(EntityTypeManagerInterface $entity_type_manager)

MediaLibraryFieldWidgetOpener constructor.

checkAccess(MediaLibraryState $state, AccountInterface $account)

Checks media library access.

getSelectionResponse(MediaLibraryState $state, array $selected_ids)

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

Details

__construct(EntityTypeManagerInterface $entity_type_manager)

MediaLibraryFieldWidgetOpener constructor.

Parameters

EntityTypeManagerInterface $entity_type_manager

The entity type manager.

AccessResultInterface checkAccess(MediaLibraryState $state, AccountInterface $account)

Checks media library access.

Parameters

MediaLibraryState $state

The media library.

AccountInterface $account

The user for which to check access.

Return Value

AccessResultInterface

The access result.

AjaxResponse getSelectionResponse(MediaLibraryState $state, array $selected_ids)

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

Parameters

MediaLibraryState $state

The state the media library was in at the time of selection, allowing the response to be customized based on that state.

array $selected_ids

The IDs of the selected media items.

Return Value

AjaxResponse

The response to update the page after selecting media.