You are here

function blockgroup_region_list in Block Group 8

Same name and namespace in other branches
  1. 7.2 blockgroup.module \blockgroup_region_list()
  2. 7 blockgroup.module \blockgroup_region_list()

Load all the block groups.

Return value

array Returns the created block groups.

1 call to blockgroup_region_list()
blockgroup_system_info_alter in ./blockgroup.module
Implements hook_system_info_alter().

File

./blockgroup.module, line 41
Block Group module hooks.

Code

function blockgroup_region_list() {
  $regions = [];

  /** @var \Drupal\blockgroup\BlockGroupContentInterface[] $blockgroups */
  $blockgroups = BlockGroupContent::loadMultiple();
  foreach ($blockgroups as $blockgroup) {
    $regions[$blockgroup
      ->id()] = (string) t('Block group: @label', [
      '@label' => $blockgroup
        ->label(),
    ]);
  }
  return $regions;
}