You are here

public function OptimizedbAdminForm::optimizeTablesSubmit in OptimizeDB 8

Optimize all tables in database.

File

src/Form/OptimizedbAdminForm.php, line 101

Class

OptimizedbAdminForm
Settings optimizedb module.

Namespace

Drupal\optimizedb\Form

Code

public function optimizeTablesSubmit(array &$form, FormStateInterface $form_state) {

  // Get all tables list.
  $tables = _optimizedb_tables_list();

  // Value is key.
  array_walk($tables, function (&$value) {
    $value = $value['name'];
  });
  _optimizedb_list_tables_operation_execute($tables, 'OPTIMIZE TABLE');
}