You are here

public static function LingotekConfigSet::getSetId in Lingotek Translation 7.6

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

Return the set ID for a given segment from the locales source

Parameters

int: the lid of a segment from the locales source

Return value

int the ID of a set of configuration segments

4 calls to LingotekConfigSet::getSetId()
LingotekSync::getDirtyConfigChunks in lib/Drupal/lingotek/LingotekSync.php
lingotek_bulk_grid_parse_config_data in ./lingotek.config.inc
lingotek_config_upload_selected in ./lingotek.config.inc
lingotek_workbench_redirect in ./lingotek.page.inc

File

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

Class

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

Code

public static function getSetId($lid, $assign = TRUE) {

  // Check if the lid already has a set:
  $existing_sid = db_select('lingotek_config_map', 'l')
    ->fields('l', array(
    'set_id',
  ))
    ->condition('lid', $lid)
    ->execute()
    ->fetchField();

  // If not, assign one to it
  if (!$existing_sid && $assign) {
    $new_sid = self::assignSetId($lid);
    return $new_sid;
  }
  return $existing_sid;
}