ContextDefinitionInterface
interface ContextDefinitionInterface (View source)
Interface used to define definition objects found in ContextInterface.
Methods
Gets a human readable label.
Sets the human readable label.
Gets a human readable description.
Sets the human readable description.
Gets the data type needed by the context.
Sets the data type needed by the context.
Determines whether the data is multi-valued, i.e. a list of data items.
Sets whether the data is multi-valued.
Determines whether the context is required.
Sets whether the data is required.
Gets the default value for this context definition.
Sets the default data value.
Gets an array of validation constraints.
Sets the array of validation constraints.
Adds a validation constraint.
Gets a validation constraint.
Details
string
getLabel()
Gets a human readable label.
$this
setLabel(string $label)
Sets the human readable label.
string|null
getDescription()
Gets a human readable description.
$this
setDescription(string|null $description)
Sets the human readable description.
string
getDataType()
Gets the data type needed by the context.
If the context is multiple-valued, this represents the type of each value.
$this
setDataType(string $data_type)
Sets the data type needed by the context.
bool
isMultiple()
Determines whether the data is multi-valued, i.e. a list of data items.
$this
setMultiple(bool $multiple = TRUE)
Sets whether the data is multi-valued.
bool
isRequired()
Determines whether the context is required.
For required data a non-NULL value is mandatory.
$this
setRequired(bool $required = TRUE)
Sets whether the data is required.
mixed
getDefaultValue()
Gets the default value for this context definition.
$this
setDefaultValue(mixed $default_value)
Sets the default data value.
array
getConstraints()
Gets an array of validation constraints.
$this
setConstraints(array $constraints)
Sets the array of validation constraints.
NOTE: This will override any previously set constraints. In most cases ContextDefinitionInterface::addConstraint() should be used instead.
$this
addConstraint(string $constraint_name, array|null $options = NULL)
Adds a validation constraint.
array
getConstraint(string $constraint_name)
Gets a validation constraint.