class Plugin implements AnnotationInterface (View source)

Defines a Plugin annotation object.

Annotations in plugin classes can use this class in order to pass various metadata about the plugin through the parser to DiscoveryInterface::getDefinitions() calls. This allows the metadata of a class to be located with the class itself, rather than in module-based info hooks.

Properties

protected array $definition

The plugin definition read from the class annotation.

Methods

__construct($values)

Constructs a Plugin object.

array
parse(array $values)

Parses an annotation into its definition.

get()

Gets the value of an annotation.

string
getProvider()

Gets the name of the provider of the annotated class.

setProvider(string $provider)

Sets the name of the provider of the annotated class.

string
getId()

Gets the unique ID for this annotated class.

string
getClass()

Gets the class of the annotated class.

setClass(string $class)

Sets the class of the annotated class.

Details

__construct($values)

Constructs a Plugin object.

Builds up the plugin definition and invokes the get() method for any classed annotations that were used.

Parameters

$values

protected array parse(array $values)

Parses an annotation into its definition.

Parameters

array $values

The annotation array.

Return Value

array

The parsed annotation as a definition.

get()

Gets the value of an annotation.

string getProvider()

Gets the name of the provider of the annotated class.

Return Value

string

setProvider(string $provider)

Sets the name of the provider of the annotated class.

Parameters

string $provider

The provider of the annotated class.

string getId()

Gets the unique ID for this annotated class.

Return Value

string

string getClass()

Gets the class of the annotated class.

Return Value

string

setClass(string $class)

Sets the class of the annotated class.

Parameters

string $class

The class of the annotated class.