You are here

function flag_entity_as_empty in Lingotek Translation 7.7

Checks if document is empty and sets or removes appropriate key in database.

Parameters

boolean $empty_entity Set to <code>TRUE</code> if document is empty. <code>FALSE</code> otherwise.:

string $entity_type String representing the entity type:

string $entity_id String representing the entity id:

LingotekXMLElement $content_obj Generated XML:

1 call to flag_entity_as_empty()
lingotek_xml_fields in ./lingotek.util.inc

File

./lingotek.util.inc, line 505
Utility functions.

Code

function flag_entity_as_empty($empty_entity, $entity_type, $id, $content_obj) {
  if ($empty_entity) {
    lingotek_keystore($entity_type, $id, 'empty_entity', LingotekSync::EMPTY_ENTITY);
    LingotekLog::warning(t('Empty XML generated for !entity_type (!id): @xml', array(
      '@xml' => $content_obj
        ->asXML(),
      '!entity_type' => $entity_type,
      '!id' => $id,
    )), NULL);
  }
  else {
    lingotek_keystore_delete($entity_type, $id, 'empty_entity');
  }
}