You are here

public function LingotekComment::deleteMetadataValue in Lingotek Translation 7.4

Deletes a Lingotek metadata value for this item

Parameters

string $key: The key for a name/value pair

File

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

Class

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

Code

public function deleteMetadataValue($key) {
  $metadata = $this
    ->metadata();
  if (isset($metadata[$key])) {
    db_delete('lingotek_entity_metadata')
      ->condition('entity_id', $this->comment->cid)
      ->condition('entity_type', self::DRUPAL_ENTITY_TYPE)
      ->condition('entity_key', $key, 'LIKE')
      ->execute();
  }
}