Mercurial > hg > cmmr2012-drupal-site
diff core/modules/block_content/src/Event/BlockContentGetDependencyEvent.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/block_content/src/Event/BlockContentGetDependencyEvent.php Thu Feb 28 13:11:55 2019 +0000 @@ -0,0 +1,70 @@ +<?php + +namespace Drupal\block_content\Event; + +use Drupal\block_content\BlockContentInterface; +use Drupal\Core\Access\AccessibleInterface; +use Symfony\Component\EventDispatcher\Event; + +/** + * Block content event to allow setting an access dependency. + * + * @internal + */ +class BlockContentGetDependencyEvent extends Event { + + /** + * The block content entity. + * + * @var \Drupal\block_content\BlockContentInterface + */ + protected $blockContent; + + /** + * The dependency. + * + * @var \Drupal\Core\Access\AccessibleInterface + */ + protected $accessDependency; + + /** + * BlockContentGetDependencyEvent constructor. + * + * @param \Drupal\block_content\BlockContentInterface $blockContent + * The block content entity. + */ + public function __construct(BlockContentInterface $blockContent) { + $this->blockContent = $blockContent; + } + + /** + * Gets the block content entity. + * + * @return \Drupal\block_content\BlockContentInterface + * The block content entity. + */ + public function getBlockContentEntity() { + return $this->blockContent; + } + + /** + * Gets the access dependency. + * + * @return \Drupal\Core\Access\AccessibleInterface + * The access dependency. + */ + public function getAccessDependency() { + return $this->accessDependency; + } + + /** + * Sets the access dependency. + * + * @param \Drupal\Core\Access\AccessibleInterface $access_dependency + * The access dependency. + */ + public function setAccessDependency(AccessibleInterface $access_dependency) { + $this->accessDependency = $access_dependency; + } + +}