You are here

public static function FormBuilderFormBase::purge in Form Builder 7

Purge old cache entries.

Parameters

int $max_age: All form_builder_cache entries older than $max_age seconds are purged.

4 calls to FormBuilderFormBase::purge()
FormBuilderAdminTest::tearDown in tests/FormBuilderAdminTest.php
Purge data stored to the form cache during the tests.
FormBuilderFormBaseTest::tearDown in tests/FormBuilderFormBaseTest.php
form_builder_cache_purge in includes/form_builder.cache.inc
Delete outdated cache entries.
form_builder_cron in ./form_builder.module
Implement hook_cron().

File

./form_builder.classes.inc, line 446

Class

FormBuilderFormBase

Code

public static function purge($max_age = NULL) {
  $expire = isset($max_age) ? $max_age : ini_get('session.cache_expire');
  return db_delete('ctools_object_cache')
    ->condition('name', 'form_builder_cache')
    ->condition('updated', REQUEST_TIME - $max_age, '<')
    ->execute();
  drupal_static_reset('ctools_object_cache_get');
}