You are here

public function LingotekEntity::getMetadataValue in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::getMetadataValue()
  2. 7.5 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::getMetadataValue()

Gets a Lingotek metadata value for this item.

Parameters

string $key: The key whose value should be returned.

Return value

string The value for the specified key, if it exists.

Overrides LingotekTranslatableEntity::getMetadataValue

File

lib/Drupal/lingotek/LingotekEntity.php, line 186
Defines LingotekEntity.

Class

LingotekEntity
A class wrapper for Lingotek-specific behavior on nodes.

Code

public function getMetadataValue($key) {
  return db_select('lingotek_entity_metadata', 'meta')
    ->fields('meta', array(
    'value',
  ))
    ->condition('entity_key', $key)
    ->condition('entity_id', $this
    ->getId())
    ->condition('entity_type', $this
    ->getEntityType())
    ->execute()
    ->fetchField();
}