FieldConfig::urlRouteParameters

protected FieldConfig::urlRouteParameters($rel)

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 Entity::urlRouteParameters

File

core/modules/field/src/Entity/FieldConfig.php, line 264

Class

FieldConfig
Defines the Field entity.

Namespace

Drupal\field\Entity

Code

protected function urlRouteParameters($rel) {
  $parameters = parent::urlRouteParameters($rel);
  $entity_type = \Drupal::entityManager()->getDefinition($this->entity_type);
  $bundle_parameter_key = $entity_type->getBundleEntityType() ? : 'bundle';
  $parameters[$bundle_parameter_key] = $this->bundle;
  return $parameters;
}
doc_Drupal
2016-10-29 09:10:41
Comments
Leave a Comment

Please login to continue.