You are here

class ContactMessageResource in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/contact/src/Plugin/rest/resource/ContactMessageResource.php \Drupal\contact\Plugin\rest\resource\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

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\resource
View source
class ContactMessageResource extends EntityResource {

  /**
   * {@inheritdoc}
   */
  public function availableMethods() {
    return [
      'POST',
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ContactMessageResource::availableMethods public function Returns the available HTTP request methods on this plugin. 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 1
DependencySerializationTrait::__wakeup public function 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 Calculates dependencies for the configured plugin. Overrides DependentPluginInterface::calculateDependencies
EntityResource::checkPatchFieldAccess protected function Checks whether the given field should be PATCHed.
EntityResource::create public static function Creates an instance of the plugin. 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 Gets the base route for a particular method. 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 Implements ResourceInterface::permissions(). 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. 29
MessengerTrait::messenger public function Gets the messenger. 29
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 3
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 Returns a collection of routes with URL path information for the resource. Overrides ResourceInterface::routes
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
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.