ADDITIONAL METHODS

get_distinct_col( $column )

Returns an asciibetical sorted list of the distinct values in the given column of the Device table. This is useful for web forms when you want to provide a drop-down list of possible options.

get_datatables_data( $params )

Returns a ResultSet for DataTables Server-side processing which populates the displayed table. Evaluates the supplied query parameters for filtering, paging, and ordering information. Note: query parameters are expected to be passed as a reference to an expanded hash of hashes.

Filtering if present, will generate simple LIKE matching conditions for each searchable column (searchability indicated by query parameters) after each column is casted to text. Conditions are combined as disjunction (OR). Note: this does not match the built-in DataTables filtering which does it word by word on any field.

Both the filtering and the ordering clauses name their columns with the columns[i][data] query parameters, and each name is used as an SQL identifier. A name must therefore be one this ResultSet resolves, that is, one of its own columns or one brought in by a join. Anything else dies.

get_datatables_filtered_count( $params )

Returns the total records, after filtering (i.e. the total number of records after filtering has been applied - not just the number of records being returned for this page of data) for a datatables ResultSet and query parameters. Note: query parameters are expected to be passed as a reference to an expanded hash of hashes.