You are here

public static function KanbanFilterForm::getDateRangeFilter in Content Planner 8

Gets the State Date Range from request.

Return value

int|null Returns the filter_date_range value if it exists, NULL otherwise.

2 calls to KanbanFilterForm::getDateRangeFilter()
KanbanFilterForm::buildForm in modules/content_kanban/src/Form/KanbanFilterForm.php
Form constructor.
KanbanService::getEntitiesByEntityIds in modules/content_kanban/src/KanbanService.php
Gets the entities by Type.

File

modules/content_kanban/src/Form/KanbanFilterForm.php, line 295

Class

KanbanFilterForm
KanbanFilterForm class.

Namespace

Drupal\content_kanban\Form

Code

public static function getDateRangeFilter() {
  if (\Drupal::request()->query
    ->has('filter_date_range')) {
    return \Drupal::request()->query
      ->get('filter_date_range');
  }
  else {
    $config = \Drupal::config(SettingsForm::CONFIG_NAME);
    $date_range = $config
      ->get('default_filter_date_range');
    if ($date_range) {
      return $date_range;
    }
  }
  return SettingsForm::DEFAULT_DATE_RANGE_VALUE;
}