You are here

public function SynonymConfigController::entityTypeBundleProviders in Synonyms 2.0.x

Routing callback to overview a particular entity type providers.

1 string reference to 'SynonymConfigController::entityTypeBundleProviders'
synonyms.routing.yml in ./synonyms.routing.yml
synonyms.routing.yml

File

src/Controller/SynonymConfigController.php, line 192

Class

SynonymConfigController
Controller for admin UI of the module.

Namespace

Drupal\synonyms\Controller

Code

public function entityTypeBundleProviders(EntityTypeInterface $synonyms_entity_type, $bundle) {
  $table = [
    '#type' => 'table',
    '#header' => [
      $this
        ->t('Provider'),
      $this
        ->t('Operations'),
    ],
  ];
  foreach ($this->providerService
    ->getSynonymConfigEntities($synonyms_entity_type
    ->id(), $bundle) as $synonym_config) {
    $table[] = [
      [
        '#markup' => Html::escape($synonym_config
          ->label()),
      ],
      [
        '#type' => 'operations',
        '#links' => $this
          ->entityTypeManager()
          ->getListBuilder($synonym_config
          ->getEntityTypeId())
          ->getOperations($synonym_config),
      ],
    ];
  }
  return $table;
}