Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / block_content / src / Event / BlockContentGetDependencyEvent.php
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 }