Skip to content

Commit

Permalink
Construct filtering fields dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis Igoumenos committed May 2, 2022
1 parent 8532a45 commit 44766a2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/src/Lib/Traits/SearchFilterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,18 @@ public function setSearchFilter(string $attribute,
bool $caseSensitive=false,
string $label=null,
bool $substring=true): void {
$this->searchFilters[$attribute] = compact('caseSensitive', 'label', 'substring');
// $this->searchFilters[$attribute] = compact('caseSensitive', 'label', 'substring');
foreach ($this->filterMetadataFields() as $column => $type) {
// If the column is an array then we are accessing the Metadata fields. Skip
if(is_array($column)) {
continue;
}
$this->searchFilters[$column] = [
'substring' => ($type === "string"),
'label' => null,
'caseSensitive' => false,
];
}
}

/**
Expand Down

0 comments on commit 44766a2

Please sign in to comment.