comparison 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
comparison
equal deleted inserted replaced
3:307d7a7fd348 4:a9cd425dd02b
1 <?php
2
3 namespace Drupal\block_content\Event;
4
5 use Drupal\block_content\BlockContentInterface;
6 use Drupal\Core\Access\AccessibleInterface;
7 use Symfony\Component\EventDispatcher\Event;
8
9 /**
10 * Block content event to allow setting an access dependency.
11 *
12 * @internal
13 */
14 class BlockContentGetDependencyEvent extends Event {
15
16 /**
17 * The block content entity.
18 *
19 * @var \Drupal\block_content\BlockContentInterface
20 */
21 protected $blockContent;
22
23 /**
24 * The dependency.
25 *
26 * @var \Drupal\Core\Access\AccessibleInterface
27 */
28 protected $accessDependency;
29
30 /**
31 * BlockContentGetDependencyEvent constructor.
32 *
33 * @param \Drupal\block_content\BlockContentInterface $blockContent
34 * The block content entity.
35 */
36 public function __construct(BlockContentInterface $blockContent) {
37 $this->blockContent = $blockContent;
38 }
39
40 /**
41 * Gets the block content entity.
42 *
43 * @return \Drupal\block_content\BlockContentInterface
44 * The block content entity.
45 */
46 public function getBlockContentEntity() {
47 return $this->blockContent;
48 }
49
50 /**
51 * Gets the access dependency.
52 *
53 * @return \Drupal\Core\Access\AccessibleInterface
54 * The access dependency.
55 */
56 public function getAccessDependency() {
57 return $this->accessDependency;
58 }
59
60 /**
61 * Sets the access dependency.
62 *
63 * @param \Drupal\Core\Access\AccessibleInterface $access_dependency
64 * The access dependency.
65 */
66 public function setAccessDependency(AccessibleInterface $access_dependency) {
67 $this->accessDependency = $access_dependency;
68 }
69
70 }