RestResource.php

Same filename in this branch
  1. 11.x core/modules/rest/src/Annotation/RestResource.php
Same filename in other branches
  1. 9 core/modules/rest/src/Annotation/RestResource.php
  2. 8.9.x core/modules/rest/src/Annotation/RestResource.php
  3. 10 core/modules/rest/src/Attribute/RestResource.php
  4. 10 core/modules/rest/src/Annotation/RestResource.php

Namespace

Drupal\rest\Attribute

File

core/modules/rest/src/Attribute/RestResource.php

View source
<?php

declare (strict_types=1);
namespace Drupal\rest\Attribute;

use Drupal\Component\Plugin\Attribute\Plugin;
use Drupal\Core\StringTranslation\TranslatableMarkup;

/**
 * Defines a REST resource attribute object.
 *
 * Plugin Namespace: Plugin\rest\resource
 *
 * For a working example, see \Drupal\dblog\Plugin\rest\resource\DbLogResource
 *
 * @see \Drupal\rest\Plugin\Type\ResourcePluginManager
 * @see \Drupal\rest\Plugin\ResourceBase
 * @see \Drupal\rest\Plugin\ResourceInterface
 * @see plugin_api
 *
 * @ingroup third_party
 */
class RestResource extends Plugin {
    
    /**
     * Constructs a RestResource attribute.
     *
     * @param string $id
     *   The REST resource plugin ID.
     * @param \Drupal\Core\StringTranslation\TranslatableMarkup $label
     *   The human-readable name of the REST resource plugin.
     * @param string|null $serialization_class
     *   (optional) The serialization class to deserialize serialized data into.
     * @param class-string|null $deriver
     *   (optional) The deriver class for the rest resource.
     * @param array $uri_paths
     *   (optional) The URI paths that this REST resource plugin provides.
     *   - key: The link relation type plugin ID.
     *   - value: The URL template.
     *
     * @see \Symfony\Component\Serializer\SerializerInterface
     * @see core/core.link_relation_types.yml
     */
    public function __construct(string $id, TranslatableMarkup $label, ?string $serialization_class = NULL, ?string $deriver = NULL, array $uri_paths = []) {
    }

}

Classes

Title Deprecated Summary
RestResource Defines a REST resource attribute object.

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