You are here

protected function LibraryItem::urlRouteParameters in Paragraphs 8

Gets an array of placeholders for this entity.

Individual entity classes may override this method to add additional placeholders if desired. If so, they should be sure to replicate the property caching logic.

Parameters

string $rel: The link relationship type, for example: canonical or edit-form.

Return value

array An array of URI placeholders.

Overrides EntityBase::urlRouteParameters

File

modules/paragraphs_library/src/Entity/LibraryItem.php, line 314

Class

LibraryItem
Defines the LibraryItem entity.

Namespace

Drupal\paragraphs_library\Entity

Code

protected function urlRouteParameters($rel) {
  $uri_route_parameters = parent::urlRouteParameters($rel);
  if ($rel === 'revision-revert' || $rel === 'revision-delete') {
    $uri_route_parameters['paragraphs_library_item_revision'] = $this
      ->getRevisionId();
  }
  return $uri_route_parameters;
}