Topvisor SDK::Fields
Additional class to manage data fields.
Class methods
- static genFilterData($name, $operator, $values) - returns an array of the filter elements
- static genOrderData($name, $direction) - returns an array of the sorting elements
- $name - filed name
- $operator - comparison operator
- $values - values operator
- $direction - sorting order (ASC or DESC)
Example
<?php //... $selectorKeywords = new TVPen($Session, 'get', 'keywords_2', 'keywords'); // add 3 filters $selectorKeywords->setFilters([ TVFields::genFilterData('name', 'CONTAIN', ['а']), // keyword with an "a" letter TVFields::genFilterData('tags', 'IN', [1, 2]), // keyword with a 1 or 2 tag TVFields::genFilterData('target', 'NOT_EQUALS', ['']) // keyword has a target link ]); // sort keywords alphabetically $selectorKeywords->serOrders([ TVFields::genOrderData('name', 'ASC') ]); //...