interface ContextDefinitionInterface in Typed Data API enhancements 8
Context definition information required by Typed Data.
The core interface is extended to add properties that are necessary for Typed Data.
Hierarchy
- interface \Drupal\Component\Plugin\Context\ContextDefinitionInterface
- interface \Drupal\Core\Plugin\Context\ContextDefinitionInterface
- interface \Drupal\typed_data\Context\ContextDefinitionInterface
- interface \Drupal\Core\Plugin\Context\ContextDefinitionInterface
Expanded class hierarchy of ContextDefinitionInterface
All classes that implement ContextDefinitionInterface
File
- src/
Context/ ContextDefinitionInterface.php, line 13
Namespace
Drupal\typed_data\ContextView source
interface ContextDefinitionInterface extends ContextDefinitionInterfaceCore {
/**
* Constants for the context assignment restriction mode.
*
* @see ::getAssignmentRestriction()
*/
const ASSIGNMENT_RESTRICTION_INPUT = 'input';
const ASSIGNMENT_RESTRICTION_SELECTOR = 'selector';
/**
* Determines if the context value is allowed to be NULL.
*
* @return bool
* TRUE if NULL values are allowed, FALSE otherwise.
*/
public function isAllowedNull();
/**
* Sets the "allow NULL value" behavior.
*
* @param bool $null_allowed
* TRUE if NULL values should be allowed, FALSE otherwise.
*
* @return $this
*/
public function setAllowNull($null_allowed);
/**
* Determines if this context has an assignment restriction.
*
* @return string|null
* Either ASSIGNMENT_RESTRICTION_INPUT for contexts that are only allowed to
* be provided as input values, ASSIGNMENT_RESTRICTION_SELECTOR for contexts
* that must be provided as data selectors or NULL if there is no
* restriction for this context.
*/
public function getAssignmentRestriction();
/**
* Sets the assignment restriction mode for this context.
*
* @param string|null $restriction
* Either ASSIGNMENT_RESTRICTION_INPUT for contexts that are only allowed to
* be provided as input values, ASSIGNMENT_RESTRICTION_SELECTOR for contexts
* that must be provided as data selectors or NULL if there is no
* restriction for this context.
*
* @return $this
*/
public function setAssignmentRestriction($restriction);
/**
* Exports the definition as an array.
*
* @return array
* An array with values for all definition keys.
*/
public function toArray();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContextDefinitionInterface:: |
public | function | Adds a validation constraint. | 1 |
ContextDefinitionInterface:: |
constant | Constants for the context assignment restriction mode. | ||
ContextDefinitionInterface:: |
constant | |||
ContextDefinitionInterface:: |
public | function | Determines if this context has an assignment restriction. | 1 |
ContextDefinitionInterface:: |
public | function | Gets a validation constraint. | 1 |
ContextDefinitionInterface:: |
public | function | Gets an array of validation constraints. | 1 |
ContextDefinitionInterface:: |
public | function | Returns the data definition of the defined context. | 1 |
ContextDefinitionInterface:: |
public | function | Gets the data type needed by the context. | 1 |
ContextDefinitionInterface:: |
public | function | Gets the default value for this context definition. | 1 |
ContextDefinitionInterface:: |
public | function | Gets a human readable description. | 1 |
ContextDefinitionInterface:: |
public | function | Gets a human readable label. | 1 |
ContextDefinitionInterface:: |
public | function | Determines if the context value is allowed to be NULL. | 1 |
ContextDefinitionInterface:: |
public | function | Determines whether the data is multi-valued, i.e. a list of data items. | 1 |
ContextDefinitionInterface:: |
public | function | Determines whether the context is required. | 1 |
ContextDefinitionInterface:: |
public | function | Determines if this definition is satisfied by a context object. | 1 |
ContextDefinitionInterface:: |
public | function | Sets the "allow NULL value" behavior. | 1 |
ContextDefinitionInterface:: |
public | function | Sets the assignment restriction mode for this context. | 1 |
ContextDefinitionInterface:: |
public | function | Sets the array of validation constraints. | 1 |
ContextDefinitionInterface:: |
public | function | Sets the data type needed by the context. | 1 |
ContextDefinitionInterface:: |
public | function | Sets the default data value. | 1 |
ContextDefinitionInterface:: |
public | function | Sets the human readable description. | 1 |
ContextDefinitionInterface:: |
public | function | Sets the human readable label. | 1 |
ContextDefinitionInterface:: |
public | function | Sets whether the data is multi-valued. | 1 |
ContextDefinitionInterface:: |
public | function | Sets whether the data is required. | 1 |
ContextDefinitionInterface:: |
public | function | Exports the definition as an array. | 1 |