class ContactMessageResource

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

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
ContactMessageResource::availableMethods public function Returns the available HTTP request methods on this plugin. Overrides EntityResource::availableMethods
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.
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 6
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.