You are here

protected function LingotekEntity::metadata in Lingotek Translation 7.6

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

Gets the local Lingotek metadata for this entity.

Return value

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

2 calls to LingotekEntity::metadata()
LingotekEntity::deleteMetadataValue in lib/Drupal/lingotek/LingotekEntity.php
Deletes a Lingotek metadata value for this item
LingotekEntity::setMetadataValue in lib/Drupal/lingotek/LingotekEntity.php
Sets a Lingotek metadata value for this item.

File

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

Class

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

Code

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