You are here

public function LingotekComment::getMetadataValue in Lingotek Translation 7.2

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

2 calls to LingotekComment::getMetadataValue()
LingotekComment::contentUpdated in lib/Drupal/lingotek/LingotekComment.php
Event handler for updates to the comment's data.
LingotekComment::lingotekDocumentId in lib/Drupal/lingotek/LingotekComment.php
Gets the Lingotek document ID for this entity.

File

lib/Drupal/lingotek/LingotekComment.php, line 294
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();
}