interface ContextInterface (View source)

Provides data and definitions for plugins during runtime and administration.

Plugin contexts are satisfied by ContextInterface implementing objects. These objects always contain a definition of what data they will provide during runtime. During run time, ContextInterface implementing objects must also provide the corresponding data value.

Methods

mixed
getContextValue()

Gets the context value.

bool
hasContextValue()

Returns whether the context has a value.

getContextDefinition()

Gets the provided definition that the context must conform to.

array
getConstraints()

Gets a list of validation constraints.

ConstraintViolationListInterface
validate()

Validates the set context value.

Details

mixed getContextValue()

Gets the context value.

Return Value

mixed

The currently set context value, or NULL if it is not set.

bool hasContextValue()

Returns whether the context has a value.

Return Value

bool

TRUE if the context has a value, FALSE otherwise.

ContextDefinitionInterface getContextDefinition()

Gets the provided definition that the context must conform to.

Return Value

ContextDefinitionInterface

The defining characteristic representation of the context.

array getConstraints()

Gets a list of validation constraints.

Return Value

array

Array of constraints, each being an instance of \Symfony\Component\Validator\Constraint.

ConstraintViolationListInterface validate()

Validates the set context value.

Return Value

ConstraintViolationListInterface

A list of constraint violations. If the list is empty, validation succeeded.