You are here

RevisionableContentEntityBase.php in Entity API 8

Same filename and directory in other branches
  1. 8.0 src/Revision/RevisionableContentEntityBase.php

File

src/Revision/RevisionableContentEntityBase.php
View source
<?php

namespace Drupal\entity\Revision;

use Drupal\Core\Entity\RevisionableContentEntityBase as BaseRevisionableContentEntityBase;

/**
 * Improves the url route handling of core's revisionable content entity base.
 */
abstract class RevisionableContentEntityBase extends BaseRevisionableContentEntityBase {

  /**
   * {@inheritdoc}
   */
  protected function urlRouteParameters($rel) {
    $uri_route_parameters = parent::urlRouteParameters($rel);
    if (strpos($this
      ->getEntityType()
      ->getLinkTemplate($rel), $this
      ->getEntityTypeId() . '_revision') !== FALSE) {
      $uri_route_parameters[$this
        ->getEntityTypeId() . '_revision'] = $this
        ->getRevisionId();
    }
    return $uri_route_parameters;
  }

}

Classes

Namesort descending Description
RevisionableContentEntityBase Improves the url route handling of core's revisionable content entity base.