You are here

public function EntityEmbedDialog::getDisplayPluginOptions in Entity Embed 8

Returns the allowed display plugins given an embed button and an entity.

Parameters

\Drupal\embed\EmbedButtonInterface $embed_button: The embed button.

\Drupal\Core\Entity\EntityInterface $entity: The entity.

Return value

array List of allowed Entity Embed Display plugins.

2 calls to EntityEmbedDialog::getDisplayPluginOptions()
EntityEmbedDialog::buildEmbedStep in src/Form/EntityEmbedDialog.php
Form constructor for the entity embedding step.
EntityEmbedDialog::validateSelectStep in src/Form/EntityEmbedDialog.php
Form validation handler for the entity selection step.

File

src/Form/EntityEmbedDialog.php, line 865

Class

EntityEmbedDialog
Provides a form to embed entities by specifying data attributes.

Namespace

Drupal\entity_embed\Form

Code

public function getDisplayPluginOptions(EmbedButtonInterface $embed_button, EntityInterface $entity) {
  $plugins = $this->entityEmbedDisplayManager
    ->getDefinitionOptionsForContext([
    'entity' => $entity,
    'entity_type' => $entity
      ->getEntityTypeId(),
    'embed_button' => $embed_button,
  ]);
  return $plugins;
}