You are here

function _settings_tray_has_block_overrides in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/settings_tray/settings_tray.module \_settings_tray_has_block_overrides()

Checks if a block has overrides.

@internal

Parameters

\Drupal\block\BlockInterface $block: The block to check for overrides.

Return value

bool TRUE if the block has overrides otherwise FALSE.

3 calls to _settings_tray_has_block_overrides()
BlockHasOverridesAccessCheck::access in core/modules/settings_tray/src/Access/BlockHasOverridesAccessCheck.php
Checks access for accessing a block's 'settings_tray' form.
settings_tray_block_view_alter in core/modules/settings_tray/settings_tray.module
Implements hook_block_view_alter().
settings_tray_preprocess_block in core/modules/settings_tray/settings_tray.module
Implements hook_preprocess_HOOK() for block templates.

File

core/modules/settings_tray/settings_tray.module, line 68
Allows configuring blocks and other configuration from the site front-end.

Code

function _settings_tray_has_block_overrides(BlockInterface $block) {

  // @todo Replace the following with $block->hasOverrides() in https://www.drupal.org/project/drupal/issues/2910353
  //   and remove this function.
  return \Drupal::config($block
    ->getEntityType()
    ->getConfigPrefix() . '.' . $block
    ->id())
    ->hasOverrides();
}