You are here

public static function CommonUtils::doVariablesCleanupByTemplate in Node expire 7.2

Cleans up variables by template.

1 call to CommonUtils::doVariablesCleanupByTemplate()
ModuleUtils::doVariablesCleanup in src/Module/Utils/ModuleUtils.php
Cleans up redundant plain variables.

File

src/Module/CommonExpire/Utils/CommonUtils.php, line 18
CommonUtils class.

Class

CommonUtils
CommonUtils class.

Namespace

Drupal\node_expire\Module\CommonExpire\Utils

Code

public static function doVariablesCleanupByTemplate($template) {
  $result = db_query("\n    SELECT name FROM {variable}\n    WHERE name LIKE '" . $template . "'");
  foreach ($result as $row) {
    variable_del($row->name);
  }
}