You are here

protected function Link::urlRouteParameters in Colossal Menu 8

Same name and namespace in other branches
  1. 2.x src/Entity/Link.php \Drupal\colossal_menu\Entity\Link::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/Link.php, line 506

Class

Link
Defines the Link entity.

Namespace

Drupal\colossal_menu\Entity

Code

protected function urlRouteParameters($rel) {
  $params = parent::urlRouteParameters($rel);
  if (in_array($rel, [
    'canonical',
    'edit-form',
    'delete-form',
  ])) {
    $params['colossal_menu'] = $this
      ->getMenuName();
  }
  return $params;
}