Loading modules/core_event_dispatcher/src/BlockHookEvents.php 0 → 100644 +64 −0 Original line number Diff line number Diff line <?php namespace Drupal\core_event_dispatcher; use Drupal\hook_event_dispatcher\HookEventDispatcherInterface; /** * Defines events for block hooks. */ class BlockHookEvents { /** * Alter the result of \Drupal\Core\Block\BlockBase::build(). * * @Event * * @see \Drupal\core_event_dispatcher\Event\Block\BlockViewAlterEvent * @see core_event_dispatcher_block_view_alter() * @see hook_block_view_alter() * * @var string */ public const BLOCK_VIEW_ALTER = HookEventDispatcherInterface::PREFIX . 'block_view.alter'; /** * Alter the result of \Drupal\Core\Block\BlockBase::build(). * * @Event * * @see \Drupal\core_event_dispatcher\Event\Block\BlockBuildAlterEvent * @see core_event_dispatcher_block_build_alter() * @see hook_block_build_alter() * * @var string */ public const BLOCK_BUILD_ALTER = HookEventDispatcherInterface::PREFIX . 'block_build.alter'; /** * Control access to a block instance. * * @Event * * @see \Drupal\core_event_dispatcher\Event\Block\BlockAccessEvent * @see core_event_dispatcher_block_access() * @see hook_block_access() * * @var string */ public const BLOCK_ACCESS = HookEventDispatcherInterface::PREFIX . 'block.access'; /** * Allow modules to alter the block plugin definitions. * * @Event * * @see \Drupal\core_event_dispatcher\Event\Block\BlockAlterEvent * @see core_event_dispatcher_block_alter() * @see hook_block_alter() * * @var string */ public const BLOCK_ALTER = HookEventDispatcherInterface::PREFIX . 'block.alter'; } modules/core_event_dispatcher/src/Event/Block/BlockAccessEvent.php +2 −2 Original line number Diff line number Diff line Loading @@ -6,10 +6,10 @@ use Drupal\block\BlockInterface; use Drupal\Component\EventDispatcher\Event; use Drupal\Core\Access\AccessResultNeutral; use Drupal\Core\Session\AccountInterface; use Drupal\core_event_dispatcher\BlockHookEvents; use Drupal\hook_event_dispatcher\Event\AccessEventInterface; use Drupal\hook_event_dispatcher\Event\AccessEventTrait; use Drupal\hook_event_dispatcher\Event\EventInterface; use Drupal\hook_event_dispatcher\HookEventDispatcherInterface; /** * Class BlockAccessEvent. Loading Loading @@ -49,7 +49,7 @@ class BlockAccessEvent extends Event implements EventInterface, AccessEventInter * {@inheritdoc} */ public function getDispatcherType(): string { return HookEventDispatcherInterface::BLOCK_ACCESS; return BlockHookEvents::BLOCK_ACCESS; } } modules/core_event_dispatcher/src/Event/Block/BlockAlterEvent.php +2 −2 Original line number Diff line number Diff line Loading @@ -2,8 +2,8 @@ namespace Drupal\core_event_dispatcher\Event\Block; use Drupal\core_event_dispatcher\BlockHookEvents; use Drupal\hook_event_dispatcher\Event\PluginDefinitionAlterEventBase; use Drupal\hook_event_dispatcher\HookEventDispatcherInterface; /** * Class BlockAlterEvent. Loading @@ -14,7 +14,7 @@ class BlockAlterEvent extends PluginDefinitionAlterEventBase { * {@inheritdoc} */ public function getDispatcherType(): string { return HookEventDispatcherInterface::BLOCK_ALTER; return BlockHookEvents::BLOCK_ALTER; } } modules/core_event_dispatcher/src/Event/Block/BlockBuildAlterEvent.php +2 −2 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace Drupal\core_event_dispatcher\Event\Block; use Drupal\hook_event_dispatcher\HookEventDispatcherInterface; use Drupal\core_event_dispatcher\BlockHookEvents; /** * Class BlockBuildAlterEvent. Loading @@ -13,7 +13,7 @@ class BlockBuildAlterEvent extends BlockViewBuilderAlterEventBase { * {@inheritdoc} */ public function getDispatcherType(): string { return HookEventDispatcherInterface::BLOCK_BUILD_ALTER; return BlockHookEvents::BLOCK_BUILD_ALTER; } } modules/core_event_dispatcher/src/Event/Block/BlockViewAlterEvent.php +2 −2 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace Drupal\core_event_dispatcher\Event\Block; use Drupal\hook_event_dispatcher\HookEventDispatcherInterface; use Drupal\core_event_dispatcher\BlockHookEvents; /** * Class BlockViewAlterEvent. Loading @@ -13,7 +13,7 @@ class BlockViewAlterEvent extends BlockViewBuilderAlterEventBase { * {@inheritdoc} */ public function getDispatcherType(): string { return HookEventDispatcherInterface::BLOCK_VIEW_ALTER; return BlockHookEvents::BLOCK_VIEW_ALTER; } } Loading
modules/core_event_dispatcher/src/BlockHookEvents.php 0 → 100644 +64 −0 Original line number Diff line number Diff line <?php namespace Drupal\core_event_dispatcher; use Drupal\hook_event_dispatcher\HookEventDispatcherInterface; /** * Defines events for block hooks. */ class BlockHookEvents { /** * Alter the result of \Drupal\Core\Block\BlockBase::build(). * * @Event * * @see \Drupal\core_event_dispatcher\Event\Block\BlockViewAlterEvent * @see core_event_dispatcher_block_view_alter() * @see hook_block_view_alter() * * @var string */ public const BLOCK_VIEW_ALTER = HookEventDispatcherInterface::PREFIX . 'block_view.alter'; /** * Alter the result of \Drupal\Core\Block\BlockBase::build(). * * @Event * * @see \Drupal\core_event_dispatcher\Event\Block\BlockBuildAlterEvent * @see core_event_dispatcher_block_build_alter() * @see hook_block_build_alter() * * @var string */ public const BLOCK_BUILD_ALTER = HookEventDispatcherInterface::PREFIX . 'block_build.alter'; /** * Control access to a block instance. * * @Event * * @see \Drupal\core_event_dispatcher\Event\Block\BlockAccessEvent * @see core_event_dispatcher_block_access() * @see hook_block_access() * * @var string */ public const BLOCK_ACCESS = HookEventDispatcherInterface::PREFIX . 'block.access'; /** * Allow modules to alter the block plugin definitions. * * @Event * * @see \Drupal\core_event_dispatcher\Event\Block\BlockAlterEvent * @see core_event_dispatcher_block_alter() * @see hook_block_alter() * * @var string */ public const BLOCK_ALTER = HookEventDispatcherInterface::PREFIX . 'block.alter'; }
modules/core_event_dispatcher/src/Event/Block/BlockAccessEvent.php +2 −2 Original line number Diff line number Diff line Loading @@ -6,10 +6,10 @@ use Drupal\block\BlockInterface; use Drupal\Component\EventDispatcher\Event; use Drupal\Core\Access\AccessResultNeutral; use Drupal\Core\Session\AccountInterface; use Drupal\core_event_dispatcher\BlockHookEvents; use Drupal\hook_event_dispatcher\Event\AccessEventInterface; use Drupal\hook_event_dispatcher\Event\AccessEventTrait; use Drupal\hook_event_dispatcher\Event\EventInterface; use Drupal\hook_event_dispatcher\HookEventDispatcherInterface; /** * Class BlockAccessEvent. Loading Loading @@ -49,7 +49,7 @@ class BlockAccessEvent extends Event implements EventInterface, AccessEventInter * {@inheritdoc} */ public function getDispatcherType(): string { return HookEventDispatcherInterface::BLOCK_ACCESS; return BlockHookEvents::BLOCK_ACCESS; } }
modules/core_event_dispatcher/src/Event/Block/BlockAlterEvent.php +2 −2 Original line number Diff line number Diff line Loading @@ -2,8 +2,8 @@ namespace Drupal\core_event_dispatcher\Event\Block; use Drupal\core_event_dispatcher\BlockHookEvents; use Drupal\hook_event_dispatcher\Event\PluginDefinitionAlterEventBase; use Drupal\hook_event_dispatcher\HookEventDispatcherInterface; /** * Class BlockAlterEvent. Loading @@ -14,7 +14,7 @@ class BlockAlterEvent extends PluginDefinitionAlterEventBase { * {@inheritdoc} */ public function getDispatcherType(): string { return HookEventDispatcherInterface::BLOCK_ALTER; return BlockHookEvents::BLOCK_ALTER; } }
modules/core_event_dispatcher/src/Event/Block/BlockBuildAlterEvent.php +2 −2 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace Drupal\core_event_dispatcher\Event\Block; use Drupal\hook_event_dispatcher\HookEventDispatcherInterface; use Drupal\core_event_dispatcher\BlockHookEvents; /** * Class BlockBuildAlterEvent. Loading @@ -13,7 +13,7 @@ class BlockBuildAlterEvent extends BlockViewBuilderAlterEventBase { * {@inheritdoc} */ public function getDispatcherType(): string { return HookEventDispatcherInterface::BLOCK_BUILD_ALTER; return BlockHookEvents::BLOCK_BUILD_ALTER; } }
modules/core_event_dispatcher/src/Event/Block/BlockViewAlterEvent.php +2 −2 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace Drupal\core_event_dispatcher\Event\Block; use Drupal\hook_event_dispatcher\HookEventDispatcherInterface; use Drupal\core_event_dispatcher\BlockHookEvents; /** * Class BlockViewAlterEvent. Loading @@ -13,7 +13,7 @@ class BlockViewAlterEvent extends BlockViewBuilderAlterEventBase { * {@inheritdoc} */ public function getDispatcherType(): string { return HookEventDispatcherInterface::BLOCK_VIEW_ALTER; return BlockHookEvents::BLOCK_VIEW_ALTER; } }