You are here

public function MultiversionManager::newSequenceId in Multiversion 8

Same name and namespace in other branches
  1. 8.2 src/MultiversionManager.php \Drupal\multiversion\MultiversionManager::newSequenceId()

@todo: {@link https://www.drupal.org/node/2597337 Consider using the nextId API to generate more sequential IDs.}

Overrides MultiversionManagerInterface::newSequenceId

See also

\Drupal\Core\Database\Connection::nextId

File

src/MultiversionManager.php, line 165

Class

MultiversionManager

Namespace

Drupal\multiversion

Code

public function newSequenceId() {

  // Multiply the microtime by 1 million to ensure we get an accurate integer.
  // Credit goes to @letharion and @logaritmisk for this simple but genius
  // solution.
  $this->lastSequenceId = (int) (microtime(TRUE) * 1000000);
  return $this->lastSequenceId;
}