Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / block / src / BlockInterface.php
1 <?php
2
3 namespace Drupal\block;
4
5 use Drupal\Core\Block\BlockPluginInterface;
6 use Drupal\Core\Config\Entity\ConfigEntityInterface;
7
8 /**
9  * Provides an interface defining a block entity.
10  */
11 interface BlockInterface extends ConfigEntityInterface {
12
13   /**
14    * Indicates the block label (title) should be displayed to end users.
15    *
16    * @deprecated in Drupal 8.3.x, will be removed before Drupal 9.0.0.
17    *   Use \Drupal\Core\Block\BlockPluginInterface::BLOCK_LABEL_VISIBLE.
18    *
19    * @see https://www.drupal.org/node/2829775
20    */
21   const BLOCK_LABEL_VISIBLE = BlockPluginInterface::BLOCK_LABEL_VISIBLE;
22
23   /**
24    * Denotes that a block is not enabled in any region and should not be shown.
25    *
26    * @deprecated Scheduled for removal in Drupal 9.0.0.
27    */
28   const BLOCK_REGION_NONE = -1;
29
30   /**
31    * Returns the plugin instance.
32    *
33    * @return \Drupal\Core\Block\BlockPluginInterface
34    *   The plugin instance for this block.
35    */
36   public function getPlugin();
37
38   /**
39    * Returns the plugin ID.
40    *
41    * @return string
42    *   The plugin ID for this block.
43    */
44   public function getPluginId();
45
46   /**
47    * Returns the region this block is placed in.
48    *
49    * @return string
50    *   The region this block is placed in.
51    */
52   public function getRegion();
53
54   /**
55    * Returns the theme ID.
56    *
57    * @return string
58    *   The theme ID for this block instance.
59    */
60   public function getTheme();
61
62   /**
63    * Returns an array of visibility condition configurations.
64    *
65    * @return array
66    *   An array of visibility condition configuration keyed by the condition ID.
67    */
68   public function getVisibility();
69
70   /**
71    * Gets conditions for this block.
72    *
73    * @return \Drupal\Core\Condition\ConditionInterface[]|\Drupal\Core\Condition\ConditionPluginCollection
74    *   An array or collection of configured condition plugins.
75    */
76   public function getVisibilityConditions();
77
78   /**
79    * Gets a visibility condition plugin instance.
80    *
81    * @param string $instance_id
82    *   The condition plugin instance ID.
83    *
84    * @return \Drupal\Core\Condition\ConditionInterface
85    *   A condition plugin.
86    */
87   public function getVisibilityCondition($instance_id);
88
89   /**
90    * Sets the visibility condition configuration.
91    *
92    * @param string $instance_id
93    *   The condition instance ID.
94    * @param array $configuration
95    *   The condition configuration.
96    *
97    * @return $this
98    */
99   public function setVisibilityConfig($instance_id, array $configuration);
100
101   /**
102    * Returns the weight of this block (used for sorting).
103    *
104    * @return int
105    *   The block weight.
106    */
107   public function getWeight();
108
109   /**
110    * Sets the region this block is placed in.
111    *
112    * @param string $region
113    *   The region to place this block in.
114    *
115    * @return $this
116    */
117   public function setRegion($region);
118
119   /**
120    * Sets the block weight.
121    *
122    * @param int $weight
123    *   The desired weight.
124    *
125    * @return $this
126    */
127   public function setWeight($weight);
128
129   /**
130    * Creates a duplicate of the block entity.
131    *
132    * @param string $new_id
133    *   (optional) The new ID on the duplicate block.
134    * @param string $new_theme
135    *   (optional) The theme on the duplicate block.
136    *
137    * @return static
138    *   A clone of $this with all identifiers unset, so saving it inserts a new
139    *   entity into the storage system.
140    */
141   public function createDuplicateBlock($new_id = NULL, $new_theme = NULL);
142
143 }