class PluginCallback in Express 8
Defines a Plugin annotation object that just contains an ID.
Hierarchy
- class \Drupal\Component\Annotation\AnnotationBase implements AnnotationInterface
- class \Drupal\Component\Annotation\PluginID
- class \Drupal\bootstrap\Annotation\PluginCallback
- class \Drupal\Component\Annotation\PluginID
Expanded class hierarchy of PluginCallback
File
- themes/
contrib/ bootstrap/ src/ Annotation/ PluginCallback.php, line 20 - Contains \Drupal\bootstrap\Annotation\PluginCallback.
Namespace
Drupal\bootstrap\AnnotationView source
class PluginCallback extends PluginID {
/**
* The plugin ID.
*
* When an annotation is given no key, 'value' is assumed by Doctrine.
*
* @var string
*/
public $value;
/**
* Flag that determines how to add the plugin to a callback array.
*
* Must be one of the following constants:
* - \Drupal\bootstrap\Bootstrap::CALLBACK_APPEND
* - \Drupal\bootstrap\Bootstrap::CALLBACK_PREPEND
* - \Drupal\bootstrap\Bootstrap::CALLBACK_REPLACE_APPEND
* - \Drupal\bootstrap\Bootstrap::CALLBACK_REPLACE_PREPEND
* Use with @ BootstrapConstant annotation.
*
* @see \Drupal\bootstrap\Bootstrap::addCallback()
*
* @var \Drupal\bootstrap\Annotation\BootstrapConstant
*/
public $action = Bootstrap::CALLBACK_APPEND;
/**
* A callback to replace.
*
* @var string
*/
public $replace = FALSE;
/**
* {@inheritdoc}
*/
public function get() {
$definition = parent::get();
$parent_properties = array_keys($definition);
$parent_properties[] = 'value';
// Merge in the defined properties.
$reflection = new \ReflectionClass($this);
foreach ($reflection
->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
$name = $property
->getName();
if (in_array($name, $parent_properties)) {
continue;
}
$value = $property
->getValue($this);
if ($value instanceof AnnotationInterface) {
$value = $value
->get();
}
$definition[$name] = $value;
}
return $definition;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AnnotationBase:: |
protected | property | The class used for this annotated class. | |
AnnotationBase:: |
public | property | The annotated class ID. | 1 |
AnnotationBase:: |
protected | property | The provider of the annotated class. | |
AnnotationBase:: |
public | function |
Gets the class of the annotated class. Overrides AnnotationInterface:: |
|
AnnotationBase:: |
public | function |
Gets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
AnnotationBase:: |
public | function |
Sets the class of the annotated class. Overrides AnnotationInterface:: |
|
AnnotationBase:: |
public | function |
Sets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
PluginCallback:: |
public | property | Flag that determines how to add the plugin to a callback array. | |
PluginCallback:: |
public | property | A callback to replace. | |
PluginCallback:: |
public | property |
The plugin ID. Overrides PluginID:: |
|
PluginCallback:: |
public | function |
Gets the value of an annotation. Overrides PluginID:: |
|
PluginID:: |
public | function |
Gets the unique ID for this annotated class. Overrides AnnotationBase:: |