You are here

protected function EntityFormProxy::getAllowedTypes in Lightning Media 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/EntityBrowser/Widget/EntityFormProxy.php \Drupal\lightning_media\Plugin\EntityBrowser\Widget\EntityFormProxy::getAllowedTypes()

Returns the media types which can be used by this widget.

Return value

\Drupal\media\MediaTypeInterface[] The media types which can be used by this widget.

4 calls to EntityFormProxy::getAllowedTypes()
EntityFormProxy::access in src/Plugin/EntityBrowser/Widget/EntityFormProxy.php
EntityFormProxy::getCurrentTypes in src/Plugin/EntityBrowser/Widget/EntityFormProxy.php
Returns all media types that can apply to the current input.
EntityFormProxy::getTypesByValue in src/Plugin/EntityBrowser/Widget/EntityFormProxy.php
Returns media types which can accept a given value in their source field.
FileUpload::getAllowedFileExtensions in src/Plugin/EntityBrowser/Widget/FileUpload.php
Returns all file extensions accepted by the allowed media types.

File

src/Plugin/EntityBrowser/Widget/EntityFormProxy.php, line 238

Class

EntityFormProxy
Base class for EB widgets which wrap around an (inline) entity form.

Namespace

Drupal\lightning_media\Plugin\EntityBrowser\Widget

Code

protected function getAllowedTypes() {
  $types = $this->entityTypeManager
    ->getStorage('media_type')
    ->loadMultiple($this->configuration['target_bundles'] ?: NULL);
  return array_filter($types, [
    $this,
    'isAllowedType',
  ]);
}