3 namespace Drupal\block_content\Event;
5 use Drupal\block_content\BlockContentInterface;
6 use Drupal\Core\Access\AccessibleInterface;
7 use Symfony\Component\EventDispatcher\Event;
10 * Block content event to allow setting an access dependency.
14 class BlockContentGetDependencyEvent extends Event {
17 * The block content entity.
19 * @var \Drupal\block_content\BlockContentInterface
21 protected $blockContent;
26 * @var \Drupal\Core\Access\AccessibleInterface
28 protected $accessDependency;
31 * BlockContentGetDependencyEvent constructor.
33 * @param \Drupal\block_content\BlockContentInterface $blockContent
34 * The block content entity.
36 public function __construct(BlockContentInterface $blockContent) {
37 $this->blockContent = $blockContent;
41 * Gets the block content entity.
43 * @return \Drupal\block_content\BlockContentInterface
44 * The block content entity.
46 public function getBlockContentEntity() {
47 return $this->blockContent;
51 * Gets the access dependency.
53 * @return \Drupal\Core\Access\AccessibleInterface
54 * The access dependency.
56 public function getAccessDependency() {
57 return $this->accessDependency;
61 * Sets the access dependency.
63 * @param \Drupal\Core\Access\AccessibleInterface $access_dependency
64 * The access dependency.
66 public function setAccessDependency(AccessibleInterface $access_dependency) {
67 $this->accessDependency = $access_dependency;