public function LingotekEntity::deleteMetadataValue in Lingotek Translation 7.7
Same name and namespace in other branches
- 7.5 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::deleteMetadataValue()
- 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 244 - 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])) {
$entity_type = $this
->getEntityType();
$entity_id = $this
->getNodeId();
db_delete('lingotek_entity_metadata')
->condition('entity_id', $entity_id)
->condition('entity_type', $entity_type)
->condition('entity_key', $key, 'LIKE')
->execute();
lingotek_cache_clear($entity_type, $entity_id);
}
}