Backend\Modules\FormBuilder\Actions\DataDetails::setFilter PHP Method

setFilter() private method

Sets the filter based on the $_GET array.
private setFilter ( )
    private function setFilter()
    {
        // start date is set
        if (isset($_GET['start_date']) && $_GET['start_date'] != '') {
            // redefine
            $startDate = (string) $_GET['start_date'];
            // explode date parts
            $chunks = explode('/', $startDate);
            // valid date
            if (count($chunks) == 3 && checkdate((int) $chunks[1], (int) $chunks[0], (int) $chunks[2])) {
                $this->filter['start_date'] = $startDate;
            } else {
                // invalid date
                $this->filter['start_date'] = '';
            }
        } else {
            // not set
            $this->filter['start_date'] = '';
        }
        // end date is set
        if (isset($_GET['end_date']) && $_GET['end_date'] != '') {
            // redefine
            $endDate = (string) $_GET['end_date'];
            // explode date parts
            $chunks = explode('/', $endDate);
            // valid date
            if (count($chunks) == 3 && checkdate((int) $chunks[1], (int) $chunks[0], (int) $chunks[2])) {
                $this->filter['end_date'] = $endDate;
            } else {
                // invalid date
                $this->filter['end_date'] = '';
            }
        } else {
            // not set
            $this->filter['end_date'] = '';
        }
    }