Unverified Commit b57afe5c authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3069696 by Berdir, andypost, dhirendra.mishra, longwave, alexpott:...

Issue #3069696 by Berdir, andypost, dhirendra.mishra, longwave, alexpott: Remove BC layers from the entity system
parent 92608738
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
@@ -374,31 +374,6 @@ public function calculateDependencies() {
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function urlInfo($rel = 'edit-form', array $options = []) {
    // Unless language was already provided, avoid setting an explicit language.
    $options += ['language' => NULL];
    return parent::urlInfo($rel, $options);
  }

  /**
   * {@inheritdoc}
   */
  public function url($rel = 'edit-form', $options = []) {
    // Do not remove this override: the default value of $rel is different.
    return parent::url($rel, $options);
  }

  /**
   * {@inheritdoc}
   */
  public function link($text = NULL, $rel = 'edit-form', array $options = []) {
    // Do not remove this override: the default value of $rel is different.
    return parent::link($text, $rel, $options);
  }

  /**
   * {@inheritdoc}
   */
+2 −9
Original line number Diff line number Diff line
@@ -1244,16 +1244,9 @@ public function __clone() {
   * {@inheritdoc}
   */
  public function label() {
    $label = NULL;
    $entity_type = $this->getEntityType();
    if (($label_callback = $entity_type->get('label_callback')) && is_callable($label_callback)) {
      @trigger_error('Entity type ' . $this->getEntityTypeId() . ' defines a label callback. Support for that is deprecated in drupal:8.0.0 and will be removed in drupal:9.0.0. Override the EntityInterface::label() method instead. See https://www.drupal.org/node/3050794', E_USER_DEPRECATED);
      $label = call_user_func($label_callback, $this);
    }
    elseif (($label_key = $entity_type->getKey('label'))) {
      $label = $this->getEntityKey('label');
    if ($this->getEntityType()->getKey('label')) {
      return $this->getEntityKey('label');
    }
    return $label;
  }

  /**
+2 −1
Original line number Diff line number Diff line
@@ -86,7 +86,8 @@ protected function getQueryServiceName() {
  /**
   * {@inheritdoc}
   */
  protected function doLoadRevisionFieldItems($revision_id) {
  protected function doLoadMultipleRevisionsFieldItems($revision_ids) {
    return [];
  }

  /**
+1 −33
Original line number Diff line number Diff line
@@ -580,45 +580,13 @@ public function loadMultipleRevisions(array $revision_ids) {
  /**
   * Actually loads revision field item values from the storage.
   *
   * @param int|string $revision_id
   *   The revision identifier.
   *
   * @return \Drupal\Core\Entity\EntityInterface|null
   *   The specified entity revision or NULL if not found.
   *
   * @deprecated in drupal:8.5.0 and is removed from drupal:9.0.0.
   *   \Drupal\Core\Entity\ContentEntityStorageBase::doLoadMultipleRevisionsFieldItems()
   *   should be implemented instead.
   *
   * @see https://www.drupal.org/node/2924915
   */
  abstract protected function doLoadRevisionFieldItems($revision_id);

  /**
   * Actually loads revision field item values from the storage.
   *
   * This method should always be overridden and not called either directly or
   * from parent::doLoadMultipleRevisionsFieldItems. It will be marked abstract
   * in drupal:9.0.0
   *
   * @param array $revision_ids
   *   An array of revision identifiers.
   *
   * @return \Drupal\Core\Entity\EntityInterface[]
   *   The specified entity revisions or an empty array if none are found.
   *
   * @todo Remove this logic and make the method abstract in
   *   https://www.drupal.org/project/drupal/issues/3069696
   */
  protected function doLoadMultipleRevisionsFieldItems($revision_ids) {
    @trigger_error('Calling ' . __NAMESPACE__ . 'ContentEntityStorageBase::doLoadMultipleRevisionsFieldItems() directly is deprecated in drupal:8.8.0 and the method will be made abstract in drupal:9.0.0. Storage implementations should override and implement their own loading logic. See https://www.drupal.org/node/3069692', E_USER_DEPRECATED);
    $revisions = [];
    foreach ($revision_ids as $revision_id) {
      $revisions[] = $this->doLoadRevisionFieldItems($revision_id);
    }

    return $revisions;
  }
  abstract protected function doLoadMultipleRevisionsFieldItems($revision_ids);

  /**
   * {@inheritdoc}
+0 −15
Original line number Diff line number Diff line
<?php

namespace Drupal\Core\Entity;

@trigger_error('The ' . __NAMESPACE__ . '\Entity is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Instead, use ' . __NAMESPACE__ . '\EntityBase. See https://www.drupal.org/node/3021808', E_USER_DEPRECATED);

/**
 * Defines a base entity class.
 *
 * @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use
 *   \Drupal\Core\Entity\EntityBase instead.
 *
 * @see https://www.drupal.org/node/3021808
 */
abstract class Entity extends EntityBase {}
Loading