3 namespace Drupal\entity\Revision;
5 use Drupal\Core\Entity\RevisionableContentEntityBase as BaseRevisionableContentEntityBase;
6 use Drupal\Core\Entity\ContentEntityBase;
9 * Improves the url route handling of core's revisionable content entity base.
11 abstract class RevisionableContentEntityBase extends BaseRevisionableContentEntityBase {
16 protected function urlRouteParameters($rel) {
17 $uri_route_parameters = [];
19 if ($rel != 'collection') {
20 // The entity ID is needed as a route parameter.
21 $uri_route_parameters[$this->getEntityTypeId()] = $this->id();
23 if (strpos($this->getEntityType()->getLinkTemplate($rel), $this->getEntityTypeId() . '_revision') !== FALSE) {
24 $uri_route_parameters[$this->getEntityTypeId() . '_revision'] = $this->getRevisionId();
27 return $uri_route_parameters;