You are here

function tft_archive_element_is_archived in Taxonomy File Tree 7.2

Check if the element is currently archived.

Parameters

int $id:

string $type: The entity type being archived. Either 'term' or 'node'.

Return value

bool

1 call to tft_archive_element_is_archived()
tft_archive_tft_item_operation_links_alter in modules/tft_archive/tft_archive.module
Implements hook_tft_item_operation_links_alter().

File

modules/tft_archive/tft_archive.module, line 243
Hook implementation and logic.

Code

function tft_archive_element_is_archived($id, $type) {
  $result = db_select('tft_archive_restore', 't')
    ->fields('t', array(
    'id',
  ))
    ->condition('id', $id)
    ->condition('type', $type)
    ->execute()
    ->fetchField();
  return !empty($result);
}