public function EntityRevision::getHighestId in Drupal 9
Same name and namespace in other branches
- 8 core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php \Drupal\migrate\Plugin\migrate\destination\EntityRevision::getHighestId()
Returns the highest ID tracked by the implementing plugin.
Return value
int The highest ID.
Overrides EntityContentBase::getHighestId
File
- core/
modules/ migrate/ src/ Plugin/ migrate/ destination/ EntityRevision.php, line 196
Class
- EntityRevision
- Provides entity revision destination plugin.
Namespace
Drupal\migrate\Plugin\migrate\destinationCode
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);
}