function EntityRevision::getHighestId

Same name and namespace in other branches
  1. 9 core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php \Drupal\migrate\Plugin\migrate\destination\EntityRevision::getHighestId()
  2. 8.9.x core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php \Drupal\migrate\Plugin\migrate\destination\EntityRevision::getHighestId()
  3. 11.x core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php \Drupal\migrate\Plugin\migrate\destination\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);
}

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