You are here

protected function LingotekComment::metadata in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.2 lib/Drupal/lingotek/LingotekComment.php \LingotekComment::metadata()
  2. 7.4 lib/Drupal/lingotek/LingotekComment.php \LingotekComment::metadata()

Gets the local Lingotek metadata for this comment.

Return value

array An array of key/value data for the current comment.

4 calls to LingotekComment::metadata()
LingotekComment::contentUpdated in lib/Drupal/lingotek/LingotekComment.php
Event handler for updates to the comment's data.
LingotekComment::setMetadataValue in lib/Drupal/lingotek/LingotekComment.php
Sets a Lingotek metadata value for this item.
LingotekComment::updateLocalContent in lib/Drupal/lingotek/LingotekComment.php
Updates the local content with data from a Lingotek Document.
LingotekComment::updateLocalContentByTarget in lib/Drupal/lingotek/LingotekComment.php
Updates the local content of $target_code with data from a Lingotek Document

File

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

Class

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

Code

protected function metadata() {
  $metadata = array();
  $results = db_select('lingotek_entity_metadata', 'meta')
    ->fields('meta')
    ->condition('entity_id', $this->comment->cid)
    ->condition('entity_type', 'comment')
    ->execute();
  foreach ($results as $result) {
    $metadata[$result->entity_key] = $result->value;
  }
  return $metadata;
}