You are here

public function LingotekEntity::deleteMetadataValue in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::deleteMetadataValue()
  2. 7.5 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 235
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();
  }
}