function tripal_delete_node_variables

2.x tripal_core.tripal_variables.api.inc tripal_delete_node_variables($nid, $name = '', $rank = '')
3.x tripal_core.tripal_variables.api.inc tripal_delete_node_variables($nid, $name = '', $rank = '')

Removes variables assigned to a node.

Parameters

$nid: The node ID

$name: Optional. The name of the variable.

$rank: Optional. The rank of the variable to retreive.

Return value

Return TRUE if deletion is successful, FALSE otherwise.

2 calls to tripal_delete_node_variables()

File

tripal_core/api/tripal_core.tripal_variables.api.inc, line 205
Provides an application programming interface (API) for managing variables associated with Tripal managed Drupal nodes/

Code

function tripal_delete_node_variables($nid, $name = '', $rank = '') {
  if (!$nid) {
    return FALSE;
  }

  $query = db_delete('tripal_node_variables')
    ->condition('nid', $nid, '=');
  if ($name) {
    $variable = tripal_get_variable($name);
    $query->condition('variable_id', $variable->variable_id, '=');
  }
  if ($rank) {
    $query->condition('rank', $rank, '=');
  }
  return $query->execute();
}