Skip to content

Commit

Permalink
Add query method getForFiltersFromArray()
Browse files Browse the repository at this point in the history
  • Loading branch information
kekefreedog committed Feb 25, 2024
1 parent feb9586 commit ce9a567
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Library/Form/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,28 @@ public static function getForFilters():array {

}

/**
* Get For Filters From Array
*
* Get query parameters for controller filters from array given
*
* @return array
*/
public static function getForFiltersFromArray(array $array = []):array {

# Set result
$result = [
0 => $array["filters"] ?? $array["filter"] ?? null, # Filters
1 => $array["sort"] ?? $array["sorting"] ?? "asc", # Sort
2 => $array["group"] ?? $array["grouping"] ?? null, # Group
3 => $array["option"] ?? $array["options"] ?? null, # Option
];

# Return result
return $result;

}

/**
* Get Arguments
*
Expand Down

0 comments on commit ce9a567

Please sign in to comment.