You are here

function _cacheflush_ui_mass_update_helper in CacheFlush 7.3

Updates individual presets when fewer than 10 are queued.

Parameters

int $id: ID of preset to update.

array $updates: Associative array of updates.

Return value

object An updated preset object.

See also

cacheflush_ui_mass_update()

2 calls to _cacheflush_ui_mass_update_helper()
cacheflush_ui_mass_update in modules/cacheflush_ui/includes/cacheflush_ui.class.inc
Make mass update of presets.
_cacheflush_ui_mass_update_batch_process in modules/cacheflush_ui/includes/cacheflush_ui.class.inc
Executes a batch operation for cacheflush_ui_mass_update().

File

modules/cacheflush_ui/includes/cacheflush_ui.class.inc, line 341
Contains the CacheflushUIController class.

Code

function _cacheflush_ui_mass_update_helper($id, array $updates) {
  $preset = cacheflush_load($id);

  // For efficiency manually save the original preset before applying any
  // changes.
  $preset->original = clone $preset;
  foreach ($updates as $name => $value) {
    $preset->{$name} = $value;
  }
  cacheflush_save($preset);
  return $preset;
}