function MediaLibraryState::getAvailableSlots

Same name in other branches
  1. 9 core/modules/media_library/src/MediaLibraryState.php \Drupal\media_library\MediaLibraryState::getAvailableSlots()
  2. 10 core/modules/media_library/src/MediaLibraryState.php \Drupal\media_library\MediaLibraryState::getAvailableSlots()
  3. 11.x 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.

2 calls to MediaLibraryState::getAvailableSlots()
MediaLibraryState::getHash in core/modules/media_library/src/MediaLibraryState.php
Get the hash for the state object.
MediaLibraryState::hasSlotsAvailable in core/modules/media_library/src/MediaLibraryState.php
Determines if additional media items can be selected.

File

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

Class

MediaLibraryState
A value object for the media library state.

Namespace

Drupal\media_library

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.