function EntityType::getUriCallback

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::getUriCallback()
  2. 10 core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::getUriCallback()
  3. 9 core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::getUriCallback()
  4. 8.9.x core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::getUriCallback()

Gets a callable that can be used to provide the entity URI.

This is only called if there is no matching link template for the link relationship type, and there is no bundle-specific callback provided.

Return value

callable|null A valid callback that is passed the entity or NULL if none is specified.

Overrides EntityTypeInterface::getUriCallback

File

core/lib/Drupal/Core/Entity/EntityType.php, line 857

Class

EntityType
Provides an implementation of an entity type and its metadata.

Namespace

Drupal\Core\Entity

Code

public function getUriCallback() {
  if ($this->uri_callback) {
    @trigger_error('The "uri_callback" property on entity types is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use link templates or a route provider to specify entity URIs. See https://www.drupal.org/node/3575062', E_USER_DEPRECATED);
  }
  return $this->uri_callback;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.