Same name in other branches
- 5.0.x src/Form/OperationsForm.php \Drupal\advagg\Form\OperationsForm::incrementCounter()
- 6.0.x src/Form/OperationsForm.php \Drupal\advagg\Form\OperationsForm::incrementCounter()
- 8.x-2.x src/Form/OperationsForm.php \Drupal\advagg\Form\OperationsForm::incrementCounter()
- 8.x-4.x src/Form/OperationsForm.php \Drupal\advagg\Form\OperationsForm::incrementCounter()
Increment the global counter. Also full cache clear.
Fichier
-
src/
Form/ OperationsForm.php, line 296
Classe
- OperationsForm
- Configure advagg settings for this site.
Namespace
Drupal\advagg\FormCode
public function incrementCounter() {
// Clear out the cache and delete aggregates.
$this->clearAggregates();
// Increment counter.
$new_value = $this->config('advagg.settings')
->get('global_counter') + 1;
$this->config('advagg.settings')
->set('global_counter', $new_value)
->save();
$this->messenger
->addMessage($this->t('Global counter is now set to %new_value', [
'%new_value' => $new_value,
]));
}