class ContactMessageResource
Customizes the entity REST Resource plugin for Contact's Message entities.
Message entities are not stored, so they cannot be:
- retrieved (GET)
- modified (PATCH)
- deleted (DELETE)
Messages can only be sent/created (POST).
Hierarchy
- class \Drupal\contact\Plugin\rest\resource\ContactMessageResource extends \Drupal\rest\Plugin\rest\resource\EntityResource
Expanded class hierarchy of ContactMessageResource
1 file declares its use of ContactMessageResource
- contact.module in core/
modules/ contact/ contact.module - Enables the use of personal and site-wide contact forms.
File
-
core/
modules/ contact/ src/ Plugin/ rest/ resource/ ContactMessageResource.php, line 16
Namespace
Drupal\contact\Plugin\rest\resourceView source
class ContactMessageResource extends EntityResource {
/**
* {@inheritdoc}
*/
public function availableMethods() {
return [
'POST',
];
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
|---|---|---|---|---|---|
| ContactMessageResource::availableMethods | public | function | Overrides EntityResource::availableMethods | ||
| DependencySerializationTrait::$_entityStorages | protected | property | An array of entity type IDs keyed by the property name of their storages. | ||
| DependencySerializationTrait::$_serviceIds | protected | property | An array of service IDs keyed by property name used for serialization. | ||
| DependencySerializationTrait::__sleep | public | function | 2 | ||
| DependencySerializationTrait::__wakeup | public | function | #[\ReturnTypeWillChange] | 2 | |
| EntityResource::$configFactory | protected | property | The config factory. | ||
| EntityResource::$entityType | protected | property | The entity type targeted by this resource. | ||
| EntityResource::$linkRelationTypeManager | protected | property | The link relation type manager used to create HTTP header links. | ||
| EntityResource::addLinkHeaders | protected | function | Adds link headers to a response. | ||
| EntityResource::calculateDependencies | public | function | Overrides DependentPluginInterface::calculateDependencies | ||
| EntityResource::checkPatchFieldAccess | protected | function | Checks whether the given field should be PATCHed. | ||
| EntityResource::create | public static | function | Overrides ResourceBase::create | ||
| EntityResource::delete | public | function | Responds to entity DELETE requests. | ||
| EntityResource::generateFallbackAccessDeniedMessage | protected | function | Generates a fallback access denied message, when no specific reason is set. | ||
| EntityResource::get | public | function | Responds to entity GET requests. | ||
| EntityResource::getBaseRoute | protected | function | Overrides ResourceBase::getBaseRoute | ||
| EntityResource::isConfigEntityResource | protected | function | Checks if this resource is for a Config Entity. | ||
| EntityResource::patch | public | function | Responds to entity PATCH requests. | ||
| EntityResource::permissions | public | function | Overrides ResourceBase::permissions | ||
| EntityResource::post | public | function | Responds to entity POST requests and saves the new entity. | ||
| EntityResource::__construct | public | function | Constructs a Drupal\rest\Plugin\rest\resource\EntityResource object. | Overrides ResourceBase::__construct | |
| EntityResourceAccessTrait::checkEditFieldAccess | protected | function | Performs edit access checks for fields. | ||
| EntityResourceValidationTrait::validate | protected | function | Verifies that an entity does not violate any validation constraints. | ||
| MessengerTrait::$messenger | protected | property | The messenger. | 25 | |
| MessengerTrait::messenger | public | function | Gets the messenger. | 25 | |
| MessengerTrait::setMessenger | public | function | Sets the messenger. | ||
| PluginBase::$configuration | protected | property | Configuration information passed into the plugin. | 1 | |
| PluginBase::$pluginDefinition | protected | property | The plugin implementation definition. | 1 | |
| PluginBase::$pluginId | protected | property | The plugin ID. | ||
| PluginBase::DERIVATIVE_SEPARATOR | constant | A string which is used to separate base plugin IDs from the derivative ID. | |||
| PluginBase::getBaseId | public | function | Gets the base_plugin_id of the plugin instance. | Overrides DerivativeInspectionInterface::getBaseId | |
| PluginBase::getDerivativeId | public | function | Gets the derivative_id of the plugin instance. | Overrides DerivativeInspectionInterface::getDerivativeId | |
| PluginBase::getPluginDefinition | public | function | Gets the definition of the plugin implementation. | Overrides PluginInspectionInterface::getPluginDefinition | 2 |
| PluginBase::getPluginId | public | function | Gets the plugin ID of the plugin instance. | Overrides PluginInspectionInterface::getPluginId | |
| PluginBase::isConfigurable | public | function | Determines if the plugin is configurable. | ||
| ResourceBase::$logger | protected | property | A logger instance. | ||
| ResourceBase::$serializerFormats | protected | property | The available serialization formats. | ||
| ResourceBase::getBaseRouteRequirements | protected | function | Gets the base route requirements for a particular method. | 1 | |
| ResourceBase::requestMethods | protected | function | Provides predefined HTTP request methods. | ||
| ResourceBase::routes | public | function | Overrides ResourceInterface::routes | ||
| StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | 3 | |
| StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | ||
| StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | ||
| StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | ||
| StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | 2 | |
| StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.