The Filter class is used to filter the data that is fetched from a table. Filters are used in the GUI to filter rows shown in the ShowList. Filters created in the GUI can be used in the API by supplying the Filter class constructor with the ID of the specific Filter.
This example creates a new filter and fetches 100 records from the table Testtable having ShowMe = 'Yes'
$filter = new Filter(); $filter->addRule( 'Testtable', 'ShowMe', FilterRule::EQUALS, 'Yes' ); $filter->getTableRecords( 'Testtable' );
This examples uses the filter created above to return the number of rows matched:
$cnt = $filter->getRecordsCount( 'Testtable' );