Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EntityRevision.php

function EntityRevision::getHighestId

Overrides EntityContentBase::getHighestId

File

core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php, line 204

Class

EntityRevision
Provides entity revision destination plugin.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

public function getHighestId() {
    $values = $this->storage
        ->getQuery()
        ->accessCheck(FALSE)
        ->allRevisions()
        ->sort($this->getKey('revision'), 'DESC')
        ->range(0, 1)
        ->execute();
    // The array keys are the revision IDs.
    // The array contains only one entry, so we can use key().
    return (int) key($values);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal