You are here

public function MediaLibraryState::getAvailableSlots in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media_library/src/MediaLibraryState.php \Drupal\media_library\MediaLibraryState::getAvailableSlots()
  2. 9 core/modules/media_library/src/MediaLibraryState.php \Drupal\media_library\MediaLibraryState::getAvailableSlots()

Returns the number of additional media items that can be selected.

When the value is not available in the URL the default is 0. When a negative integer is passed, an unlimited amount of media items can be selected.

Return value

int The number of additional media items that can be selected.

File

core/modules/media_library/src/MediaLibraryState.php, line 260

Class

MediaLibraryState
A value object for the media library state.

Namespace

Drupal\media_library

Code

public function getAvailableSlots() {
  return $this
    ->getInt('media_library_remaining');
}