annotate core/modules/block_content/src/Access/DependentAccessInterface.php @ 5:12f9dff5fda9
tip
Update to Drupal core 8.7.1
author |
Chris Cannam |
date |
Thu, 09 May 2019 15:34:47 +0100 |
parents |
a9cd425dd02b |
children |
|
rev |
line source |
Chris@4
|
1 <?php
|
Chris@4
|
2
|
Chris@4
|
3 namespace Drupal\block_content\Access;
|
Chris@4
|
4
|
Chris@4
|
5 /**
|
Chris@4
|
6 * Interface for AccessibleInterface objects that have an access dependency.
|
Chris@4
|
7 *
|
Chris@4
|
8 * Objects should implement this interface when their access depends on access
|
Chris@4
|
9 * to another object that implements \Drupal\Core\Access\AccessibleInterface.
|
Chris@4
|
10 * This interface simply provides the getter method for the access
|
Chris@4
|
11 * dependency object. Objects that implement this interface are responsible for
|
Chris@4
|
12 * checking access of the access dependency because the dependency may not take
|
Chris@4
|
13 * effect in all cases. For instance an entity may only need the access
|
Chris@4
|
14 * dependency set when it is embedded within another entity and its access
|
Chris@4
|
15 * should be dependent on access to the entity in which it is embedded.
|
Chris@4
|
16 *
|
Chris@4
|
17 * To check the access to the dependency the object implementing this interface
|
Chris@4
|
18 * can use code like this:
|
Chris@4
|
19 * @code
|
Chris@4
|
20 * $accessible->getAccessDependency()->access($op, $account, TRUE);
|
Chris@4
|
21 * @endcode
|
Chris@4
|
22 *
|
Chris@4
|
23 * @internal
|
Chris@4
|
24 */
|
Chris@4
|
25 interface DependentAccessInterface {
|
Chris@4
|
26
|
Chris@4
|
27 /**
|
Chris@4
|
28 * Gets the access dependency.
|
Chris@4
|
29 *
|
Chris@4
|
30 * @return \Drupal\Core\Access\AccessibleInterface|null
|
Chris@4
|
31 * The access dependency or NULL if none has been set.
|
Chris@4
|
32 */
|
Chris@4
|
33 public function getAccessDependency();
|
Chris@4
|
34
|
Chris@4
|
35 }
|