You are here

protected function FlaggingCollection::urlRouteParameters in Flag Lists 8

Same name and namespace in other branches
  1. 4.0.x src/Entity/FlaggingCollection.php \Drupal\flag_lists\Entity\FlaggingCollection::urlRouteParameters()

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

src/Entity/FlaggingCollection.php, line 393

Class

FlaggingCollection
Defines the Flagging collection entity.

Namespace

Drupal\flag_lists\Entity

Code

protected function urlRouteParameters($rel) {
  $uri_route_parameters = parent::urlRouteParameters($rel);
  if ($rel === 'revision_revert' && $this instanceof RevisionableContentEntityBase) {
    $uri_route_parameters[$this
      ->getEntityTypeId() . '_revision'] = $this
      ->getRevisionId();
  }
  elseif ($rel === 'revision_delete' && $this instanceof RevisionableContentEntityBase) {
    $uri_route_parameters[$this
      ->getEntityTypeId() . '_revision'] = $this
      ->getRevisionId();
  }
  return $uri_route_parameters;
}