You are here

protected static function LingotekConfigChunk::getChunkMeta in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.3 lib/Drupal/lingotek/LingotekConfigChunk.php \LingotekConfigChunk::getChunkMeta()
  2. 7.4 lib/Drupal/lingotek/LingotekConfigChunk.php \LingotekConfigChunk::getChunkMeta()

Return any metadata for the given chunk ID, if it exists

Parameters

int $chunk_id:

Return value

array An array containing anything for the chunk_id from table lingotek_config_metadata

1 call to LingotekConfigChunk::getChunkMeta()
LingotekConfigChunk::__construct in lib/Drupal/lingotek/LingotekConfigChunk.php
Constructor.

File

lib/Drupal/lingotek/LingotekConfigChunk.php, line 352
Defines LingotekConfigChunk.

Class

LingotekConfigChunk
A class wrapper for Lingotek-specific behavior on ConfigChunks.

Code

protected static function getChunkMeta($chunk_id) {
  $query = db_select('{lingotek_config_metadata}', 'l');
  $query
    ->fields('l', array(
    'id',
    'config_key',
    'value',
  ));
  $query
    ->condition('l.id', $chunk_id);
  $result = $query
    ->execute();
  $response = array();
  while ($record = $result
    ->fetch()) {
    $response[$record->config_key] = $record->value;
  }
  return $response;
}