public property EntityType::$links

Link templates using the URI template syntax.

Links are an array of standard link relations to the URI template that should be used for them. Where possible, link relationships should use established IANA relationships rather than custom relationships.

Every entity type should, at minimum, define "canonical", which is the pattern for URIs to that entity. Even if the entity will have no HTML page exposed to users it should still have a canonical URI in order to be compatible with web services. Entities that will be user-editable via an HTML page must also define an "edit-form" relationship.

By default, the following placeholders are supported:

  • entityType: The machine name of the entity type.
  • bundle: The bundle machine name of the entity.
  • id: The unique ID of the entity.
  • uuid: The UUID of the entity.
  • [entityType]: The entity type itself will also be a valid token for the ID of the entity. For instance, a placeholder of {node} used on the Node class would have the same value as {id}. This is generally preferred over "id" for better self-documentation.

Specific entity types may also expand upon this list by overriding the uriPlaceholderReplacements() method.

http://www.iana.org/assignments/link-relations/link-relations.xml http://tools.ietf.org/html/rfc6570

Type: array

File

drupal/core/lib/Drupal/Core/Entity/Annotation/EntityType.php, line 286
Contains \Drupal\Core\Entity\Annotation\EntityType.

Class

EntityType
Defines an Entity type annotation object.

Namespace

Drupal\Core\Entity\Annotation

Code

public $links = array(
  'canonical' => '/entity/{entityType}/{id}',
);