You are here

public function LingotekComment::getMetadataValue in Lingotek Translation 7.4

Same name and namespace in other branches
  1. 7.2 lib/Drupal/lingotek/LingotekComment.php \LingotekComment::getMetadataValue()
  2. 7.3 lib/Drupal/lingotek/LingotekComment.php \LingotekComment::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 LingotekComment::getMetadataValue()
LingotekComment::lingotekDocumentId in lib/Drupal/lingotek/LingotekComment.php
Gets the Lingotek document ID for this entity.

File

lib/Drupal/lingotek/LingotekComment.php, line 272
Defines LingotekComment.

Class

LingotekComment
A class wrapper for Lingotek-specific behavior on Comments.

Code

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