You are here

protected function EntitySubmenuBlock::getEntityTypes in Entity Submenu Block 8

Returns a list of valid entity types.

Return value

array Valid entity type names.

3 calls to EntitySubmenuBlock::getEntityTypes()
EntitySubmenuBlock::blockForm in src/Plugin/Block/EntitySubmenuBlock.php
EntitySubmenuBlock::blockSubmit in src/Plugin/Block/EntitySubmenuBlock.php
EntitySubmenuBlock::build in src/Plugin/Block/EntitySubmenuBlock.php
Builds and returns the renderable array for this block plugin.

File

src/Plugin/Block/EntitySubmenuBlock.php, line 271

Class

EntitySubmenuBlock
Provides an Entity Submenu Block.

Namespace

Drupal\entity_submenu_block\Plugin\Block

Code

protected function getEntityTypes() {
  $entity_types = [
    'node',
  ];
  foreach ($this->entityTypes as $entity_type => $definition) {
    if ($entity_type != 'node' && $this
      ->isValidEntity($entity_type)) {
      $entity_types[] = $entity_type;
    }
  }
  return $entity_types;
}