You are here

function context_delete in Context 6.3

Same name and namespace in other branches
  1. 7.3 context.module \context_delete()

Deletes an existing context.

Parameters

$context: The context object to be deleted.

Return value

Returns true on success, false on failure.

14 calls to context_delete()
ContextConditionBookroot::test in tests/context.conditions.test
ContextConditionBookTest::test in tests/context.conditions.test
ContextConditionContextTest::test in tests/context.conditions.test
ContextConditionLanguageTest::test in tests/context.conditions.test
ContextConditionMenuTest::test in tests/context.conditions.test

... See full list

File

./context.module, line 252

Code

function context_delete($context) {
  if (isset($context->name) && $context->export_type & EXPORT_IN_DATABASE) {
    db_query("DELETE FROM {context} WHERE name = '%s'", $context->name);
    context_invalidate_cache();
    return TRUE;
  }
  return FALSE;
}