protected function BlockVisibilityLister::getBlockVisibilityLabels in Block Visibility Groups 8
Get labels for groups.
Return value
array The list of labels.
3 calls to BlockVisibilityLister::getBlockVisibilityLabels()
- BlockVisibilityGroupDeleteForm::buildForm in src/
Form/ BlockVisibilityGroupDeleteForm.php - Form constructor.
- BlockVisibilityGroupedListBuilder::addGroupColumn in src/
BlockVisibilityGroupedListBuilder.php - Add Column to show Visibility Group.
- BlockVisibilityGroupedListBuilder::getBlockVisibilityGroupOptions in src/
BlockVisibilityGroupedListBuilder.php - Get Group options info to group select dropdown.
File
- src/
BlockVisibilityLister.php, line 19
Class
- BlockVisibilityLister
- Provides functionality to get block visibility conditions and labels.
Namespace
Drupal\block_visibility_groupsCode
protected function getBlockVisibilityLabels(EntityStorageInterface $storage) {
$block_visibility_groups = $storage
->loadMultiple();
$labels = [];
foreach ($block_visibility_groups as $type) {
$labels[$type
->id()] = $type
->label();
}
return $labels;
}