samsonos / cms_api
SamsonCMS API module
Installs: 4 024
Dependents: 4
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 7
Open Issues: 3
Requires
Requires (Dev)
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2024-12-18 13:51:59 UTC
README
#SamsonCMS API
This is core classes to interact with SamsonCMS database structure
Read module documentation:
Class Filter
This class has static methods to work with filter
table. They are:
- createFilter() method allows you to create new row in
filter
table; - resetFilters() method generates new filters from
materialfield
table. It takes only records which have filter type. Filter type can de set by CMS or directly infield
table.
Also it has inner collection of 'filter' class objects and some methods to work with them.
- Method add() takes filter identifier as parameter and adds this filter to the collection.
- getFiltersByField() method has 1 input value: filtered field identifier. It returns array of filters related to this field.
- performFilters() method searches for suitable results, performing all filters which are in collection.
The result is array of materials, it can be get by setting first parameter of this function.
Other parameters are:
- Structures which result materials should belong to;
- External handler name. It will be called before SQL query will execute.
- External handler parameters array, this parameters will be added to query, which is first parameter of external handler function, and filters array, which is second parameter. That's the main info about this class!