|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| getMapperInterfaceName () | |
| addField ($field, $alias=null) | |
| addFilter ($name, $field, $condition=null, $type='and') | |
| addOrder ($field, $direction=self::SORT_ORDER_DESC, $unShift=false) | |
| setLimit ($offset, $size) | |
| removeField ($field, $isAlias=false) | |
| removeAllFields () | |
| removeFilter ($name) | |
| removeAllFilters () | |
| getCriteriaList () | |
| getFilters () | |
| getOrders () | |
| getLimit () | |
| getPart ($name, $default=null) | |
| toArray () | |
| reset () | |
Protected Attributes | |
| $data | |
| $mapperInterfaceName | |
Additional Inherited Members | |
Data Fields inherited from CriteriaInterface | |
| const | PART_FIELDS = 'fields' |
| const | PART_FILTERS = 'filters' |
| const | PART_ORDERS = 'orders' |
| const | PART_CRITERIA_LIST = 'criteria_list' |
| const | PART_LIMIT = 'limit' |
| const | SORT_ORDER_ASC = 'ASC' |
| const | SORT_ORDER_DESC = 'DESC' |
Class AbstractCriteria
Definition at line 13 of file AbstractCriteria.php.
| addField | ( | $field, | |
$alias = null |
|||
| ) |
Add field to select
| string | array | $field | |
| string | null | $alias |
Implements CriteriaInterface.
Definition at line 56 of file AbstractCriteria.php.
| addFilter | ( | $name, | |
| $field, | |||
$condition = null, |
|||
$type = 'and' |
|||
| ) |
Add field filter to collection
If $condition integer or string - exact value will be filtered ('eq' condition)
If $condition is array - one of the following structures is expected:
If non matched - sequential parallel arrays are expected and OR conditions will be built using above mentioned structure.
Example:$field = ['age', 'name']; $condition = [42, ['like' => 'Mage']]; $type = 'or';The above would find where age equal to 42 OR name like Mage%.
| string | $name | |
| string | array | $field | |
| string | int | array | $condition | |
| string | $type |
Implements CriteriaInterface.
Definition at line 116 of file AbstractCriteria.php.
| addOrder | ( | $field, | |
$direction = self::SORT_ORDER_DESC, |
|||
$unShift = false |
|||
| ) |
self::setOrder() alias
| string | $field | |
| string | $direction | |
| bool | $unShift |
Implements CriteriaInterface.
Definition at line 143 of file AbstractCriteria.php.
| getCriteriaList | ( | ) |
Get Criteria objects added to current Composite Criteria
Implements CriteriaInterface.
Definition at line 232 of file AbstractCriteria.php.
| getFilters | ( | ) |
Get list of filters
Implements CriteriaInterface.
Definition at line 242 of file AbstractCriteria.php.
| getLimit | ( | ) |
Get limit (['offset', 'page'])
Implements CriteriaInterface.
Definition at line 263 of file AbstractCriteria.php.
| getMapperInterfaceName | ( | ) |
Get associated Mapper Interface name
Implements CriteriaInterface.
Definition at line 36 of file AbstractCriteria.php.
| getOrders | ( | ) |
Get ordering criteria
Implements CriteriaInterface.
Definition at line 252 of file AbstractCriteria.php.
| getPart | ( | $name, | |
$default = null |
|||
| ) |
Retrieve criteria part
| string | $name | |
| mixed | $default |
Implements CriteriaInterface.
Definition at line 275 of file AbstractCriteria.php.
| removeAllFields | ( | ) |
Removes all fields from select
Implements CriteriaInterface.
Definition at line 199 of file AbstractCriteria.php.
| removeAllFilters | ( | ) |
Removes all filters
Implements CriteriaInterface.
Definition at line 222 of file AbstractCriteria.php.
| removeField | ( | $field, | |
$isAlias = false |
|||
| ) |
Removes field from select
| string | null | $field | |
| bool | $isAlias | Alias identifier |
Implements CriteriaInterface.
Definition at line 178 of file AbstractCriteria.php.
| removeFilter | ( | $name | ) |
Removes filter by name
| string | $name |
Implements CriteriaInterface.
Definition at line 210 of file AbstractCriteria.php.
| reset | ( | ) |
Reset criteria
Implements CriteriaInterface.
Definition at line 295 of file AbstractCriteria.php.
| setLimit | ( | $offset, | |
| $size | |||
| ) |
Set Query limit
| int | $offset | |
| int | $size |
Implements CriteriaInterface.
Definition at line 166 of file AbstractCriteria.php.
| toArray | ( | ) |
Return all criteria parts as array
Implements CriteriaInterface.
Definition at line 285 of file AbstractCriteria.php.
|
protected |
Definition at line 18 of file AbstractCriteria.php.
|
protected |
Definition at line 28 of file AbstractCriteria.php.