Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RestResource.php

function RestResource::__construct

Constructs a RestResource attribute.

Parameters

string $id: The REST resource plugin ID.

\Drupal\Core\StringTranslation\TranslatableMarkup $label: The human-readable name of the REST resource plugin.

string|null $serialization_class: (optional) The serialization class to deserialize serialized data into.

class-string|null $deriver: (optional) The deriver class for the rest resource.

array $uri_paths: (optional) The URI paths that this REST resource plugin provides.

  • key: The link relation type plugin ID.
  • value: The URL template.

Overrides Plugin::__construct

See also

\Symfony\Component\Serializer\SerializerInterface

core/core.link_relation_types.yml

File

core/modules/rest/src/Attribute/RestResource.php, line 46

Class

RestResource
Defines a REST resource attribute object.

Namespace

Drupal\rest\Attribute

Code

public function __construct(string $id, TranslatableMarkup $label, ?string $serialization_class = NULL, ?string $deriver = NULL, array $uri_paths = []) {
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal