You are here

protected static function LingotekConfigSet::getNextSetId in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekConfigSet.php \LingotekConfigSet::getNextSetId()
1 call to LingotekConfigSet::getNextSetId()
LingotekConfigSet::createSet in lib/Drupal/lingotek/LingotekConfigSet.php

File

lib/Drupal/lingotek/LingotekConfigSet.php, line 281
Defines LingotekConfigSet.

Class

LingotekConfigSet
A class wrapper for Lingotek-specific behavior on ConfigSets.

Code

protected static function getNextSetId() {
  $query = db_select('lingotek_config_metadata', 'lcm');
  $query
    ->addExpression('MAX(id)');
  $max_set_id = $query
    ->execute()
    ->fetchField();
  if ($max_set_id) {
    return (int) $max_set_id + 1;
  }
  return 1;
}