public function getFilters($columnDescriptions = [], $activeFieldName = false)
     {
         $filters = [];

         if (count($this->filtersArray) > 0) {
             foreach ($this->filtersArray as $key => $value) {
                 if (isset($this->filters[$key])) {

                     // Filters are active on the active data column
                     $activeFieldName = $activeFieldName?: $this->filtersArray['orderBy'];

                     // There may optionally be passed in a more human friendly name for the active field.
                     $friendlyFieldName = isset($columnDescriptions[$activeFieldName]) ? $columnDescriptions[$activeFieldName] : $activeFieldName;

                     $filters[] = sprintf($this->filters[$key], $friendlyFieldName, $value);
                     //$filters[] = call_user_func_array("sprintf", [$this->filters[$key], ]);
                 }
             }
         }
         return $filters;
     }
public function getFilters($columnDescriptions = [], $activeFieldName = false)
     {
         $filters = [];

         if (count($this->filtersArray) > 0) {
             foreach ($this->filtersArray as $key => $value) {
                 if (isset($this->filters[$key])) {

                     // Filters are active on the active data column
                     $activeFieldName = $activeFieldName?: $this->filtersArray['orderBy'];

                     // There may optionally be passed in a more human friendly name for the active field.
                     $friendlyFieldName = isset($columnDescriptions[$activeFieldName]) ? $columnDescriptions[$activeFieldName] : $activeFieldName;

                     $filters[] = sprintf($this->filters[$key], $friendlyFieldName, $value);
                     //$filters[] = call_user_func_array("sprintf", [$this->filters[$key], ]);
                 }
             }
         }
         return $filters;
     }
public function getFilters ( $ columnDescriptions = [ ] , $ activeFieldName = false ) { $ filters = [ ] ; if ( count ( $ this -> filtersArray ) > 0 ) { foreach ( $ this -> filtersArray as $ key => $ value ) { if ( isset ( $ this -> filters [ $ key ] ) ) { // Filters are active on the active data column $ activeFieldName = $ activeFieldName ? : $ this -> filtersArray [ 'orderBy' ] ; // There may optionally be passed in a more human friendly name for the active field. $ friendlyFieldName = isset ( $ columnDescriptions [ $ activeFieldName ] ) ? $ columnDescriptions [ $ activeFieldName ] : $ activeFieldName ; $ filters [ ] = sprintf ( $ this -> filters [ $ key ] , $ friendlyFieldName , $ value ) ; //$filters[] = call_user_func_array("sprintf", [$this->filters[$key], ]); } } } return $ filters ; }
Returns an array with messages to inform the end-user what filters they have active.
Will look in the Filters array for letterFilters or search queries that are limiting the result set.
In order to return a user-friendly description of what filters are active, it requires an array of column
descriptions. See example below.

$columnDescriptions = ['practices.name' => 'practices'];
$this->filtersArray = ['query' => 'Happy'];
$this->filters = ['query' => 'Showing %s that contain "%s"'];
RETURNED RESULT: ['Showing practices that contain "Happy"']
Returns an array with messages to inform the end - user what filters they have active . Will look in the Filters array for letterFilters or search queries that are limiting the result set . In order to return a user - friendly description of what filters are active it requires an array of column descriptions . See example below .