class PluginExample in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/plugin_test/src/Plugin/Annotation/PluginExample.php \Drupal\plugin_test\Plugin\Annotation\PluginExample
- 9 core/modules/system/tests/modules/plugin_test/src/Plugin/Annotation/PluginExample.php \Drupal\plugin_test\Plugin\Annotation\PluginExample
Defines a custom Plugin annotation.
Hierarchy
- class \Drupal\Component\Annotation\AnnotationBase implements AnnotationInterface
- class \Drupal\plugin_test\Plugin\Annotation\PluginExample
Expanded class hierarchy of PluginExample
Related topics
2 classes are annotated with PluginExample
- Example1 in core/
modules/ system/ tests/ modules/ plugin_test/ src/ Plugin/ plugin_test/ custom_annotation/ Example1.php - Provides a test plugin with a custom annotation.
- Example2 in core/
modules/ system/ tests/ modules/ plugin_test/ src/ Plugin/ plugin_test/ custom_annotation/ Example2.php - Provides a test plugin with a custom annotation.
File
- core/
modules/ system/ tests/ modules/ plugin_test/ src/ Plugin/ Annotation/ PluginExample.php, line 12
Namespace
Drupal\plugin_test\Plugin\AnnotationView source
class PluginExample extends AnnotationBase {
/**
* The plugin ID.
*
* @var string
*/
public $id;
/**
* Another plugin metadata.
*
* @var string
*/
public $custom;
/**
* {@inheritdoc}
*/
public function get() {
return [
'id' => $this->id,
'custom' => $this->custom,
'class' => $this->class,
'provider' => $this->provider,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AnnotationBase:: |
protected | property | The class used for this annotated class. | |
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 unique ID for this annotated class. Overrides AnnotationInterface:: |
1 |
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:: |
|
PluginExample:: |
public | property | Another plugin metadata. | |
PluginExample:: |
public | property |
The plugin ID. Overrides AnnotationBase:: |
|
PluginExample:: |
public | function |
Gets the value of an annotation. Overrides AnnotationInterface:: |