You are here

public function LingotekManagementFormBase::resetFilterForm in Lingotek Translation 3.5.x

Same name and namespace in other branches
  1. 8.2 src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::resetFilterForm()
  2. 4.0.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::resetFilterForm()
  3. 3.0.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::resetFilterForm()
  4. 3.1.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::resetFilterForm()
  5. 3.2.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::resetFilterForm()
  6. 3.3.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::resetFilterForm()
  7. 3.4.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::resetFilterForm()
  8. 3.6.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::resetFilterForm()
  9. 3.7.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::resetFilterForm()
  10. 3.8.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::resetFilterForm()

Form submission handler for resetting the filters.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

File

src/Form/LingotekManagementFormBase.php, line 433

Class

LingotekManagementFormBase
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

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

  /** @var \Drupal\user\PrivateTempStore $temp_store */
  $temp_store = $this->tempStoreFactory
    ->get($this
    ->getTempStorageFilterKey());
  $keys = $this
    ->getFilterKeys();
  foreach ($keys as $key) {

    // Reset the filter, no matter if it's under 'wrapper' or 'advanced_filters.'
    $temp_store
      ->delete($key[1]);
  }
}