You are here

public function LingotekEntity::getMetadataValue in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.5 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::getMetadataValue()
  2. 7.6 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

1 call to LingotekEntity::getMetadataValue()
LingotekEntity::setExclusiveTargetsStatus in lib/Drupal/lingotek/LingotekEntity.php

File

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

Class

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

Code

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