function EntityContentBase::getHighestId

Same name and namespace in other branches
  1. 11.x core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php \Drupal\migrate\Plugin\migrate\destination\EntityContentBase::getHighestId()

Returns the highest ID tracked by the implementing plugin.

Return value

int The highest ID.

Overrides HighestIdInterface::getHighestId

File

core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php, line 402

Class

EntityContentBase
Provides destination class for all content entities lacking a specific class.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

public function getHighestId() {
  $values = $this->storage
    ->getQuery()
    ->accessCheck(FALSE)
    ->sort($this->getKey('id'), 'DESC')
    ->range(0, 1)
    ->execute();
  return (int) current($values);
}

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