You are here

protected function EntityFormProxy::getCurrentTypes in Lightning Media 8.4

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

Returns all media types that can apply to the current input.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: The current form state.

Return value

\Drupal\media\MediaTypeInterface[] The media types that can apply to the current input, if any.

2 calls to EntityFormProxy::getCurrentTypes()
EntityFormProxy::getCurrentEntity in src/Plugin/EntityBrowser/Widget/EntityFormProxy.php
Returns a media entity created from the current input, if possible.
EntityFormProxy::getForm in src/Plugin/EntityBrowser/Widget/EntityFormProxy.php

File

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

Class

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

Namespace

Drupal\lightning_media\Plugin\EntityBrowser\Widget

Code

protected function getCurrentTypes(FormStateInterface $form_state) {
  $value = $this
    ->getCurrentValue($form_state);
  return $value ? $this
    ->getTypesByValue($value) : $this
    ->getAllowedTypes();
}