class RestResource in Drupal 9
Same name and namespace in other branches
- 8 core/modules/rest/src/Annotation/RestResource.php \Drupal\rest\Annotation\RestResource
- 10 core/modules/rest/src/Annotation/RestResource.php \Drupal\rest\Annotation\RestResource
Defines a REST resource annotation object.
Plugin Namespace: Plugin\rest\resource
For a working example, see \Drupal\dblog\Plugin\rest\resource\DBLogResource
Hierarchy
- class \Drupal\Component\Annotation\Plugin implements AnnotationInterface
- class \Drupal\rest\Annotation\RestResource
Expanded class hierarchy of RestResource
See also
\Drupal\rest\Plugin\Type\ResourcePluginManager
\Drupal\rest\Plugin\ResourceBase
\Drupal\rest\Plugin\ResourceInterface
Related topics
5 classes are annotated with RestResource
- DBLogResource in core/
modules/ dblog/ src/ Plugin/ rest/ resource/ DBLogResource.php - Provides a resource for database watchdog log entries.
- EntityResource in core/
modules/ rest/ src/ Plugin/ rest/ resource/ EntityResource.php - Represents entities as resources.
- FileUploadResource in core/
modules/ file/ src/ Plugin/ rest/ resource/ FileUploadResource.php - File upload resource.
- NoSerializationClassTestResource in core/
modules/ rest/ tests/ modules/ rest_test/ src/ Plugin/ rest/ resource/ NoSerializationClassTestResource.php - Class used to test that serialization_class is optional.
- UserRegistrationResource in core/
modules/ user/ src/ Plugin/ rest/ resource/ UserRegistrationResource.php - Represents user registration as a resource.
File
- core/
modules/ rest/ src/ Annotation/ RestResource.php, line 23
Namespace
Drupal\rest\AnnotationView source
class RestResource extends Plugin {
/**
* The REST resource plugin ID.
*
* @var string
*/
public $id;
/**
* The human-readable name of the REST resource plugin.
*
* @ingroup plugin_translatable
*
* @var \Drupal\Core\Annotation\Translation
*/
public $label;
/**
* The serialization class to deserialize serialized data into.
*
* @see \Symfony\Component\Serializer\SerializerInterface's "type" parameter.
*
* @var string (optional)
*/
public $serialization_class;
/**
* The URI paths that this REST resource plugin provides.
*
* Key-value pairs, with link relation type plugin IDs as keys, and URL
* templates as values.
*
* @see core/core.link_relation_types.yml
*
* @var string[]
*/
public $uri_paths = [];
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Plugin:: |
protected | property | The plugin definition read from the class annotation. | 1 |
Plugin:: |
public | function |
Gets the value of an annotation. Overrides AnnotationInterface:: |
5 |
Plugin:: |
public | function |
Gets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the unique ID for this annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
1 |
Plugin:: |
protected | function | Parses an annotation into its definition. | |
Plugin:: |
public | function |
Sets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Sets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function | Constructs a Plugin object. | 2 |
RestResource:: |
public | property | The REST resource plugin ID. | |
RestResource:: |
public | property | The human-readable name of the REST resource plugin. | |
RestResource:: |
public | property | The serialization class to deserialize serialized data into. | |
RestResource:: |
public | property | The URI paths that this REST resource plugin provides. |