You are here

public function LingotekEntity::deleteMetadataValue in Lingotek Translation 7.5

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

Deletes a Lingotek metadata value for this item

Parameters

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

File

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

Class

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

Code

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