You are here

protected static function LingotekConfigSet::hasMaxChars in Lingotek Translation 7.6

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

File

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

Class

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

Code

protected static function hasMaxChars($set_id) {
  $lids = self::getLidsFromSets($set_id);
  if (!empty($lids)) {
    $query = db_select('locales_source', 'ls')
      ->fields('ls', array(
      'source',
    ))
      ->condition('lid', $lids, 'IN')
      ->execute();
    $strings_array = $query
      ->fetchCol();
    $strings = implode('', $strings_array);
    if (strlen($strings) > LINGOTEK_CONFIG_MAX_SOURCE_LENGTH) {
      return TRUE;
    }
  }
  return FALSE;
}