Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
map (\Magento\Framework\Api\CriteriaInterface $criteria) | |
getResource () | |
addExpressionFieldToSelect ($alias, $expression, $fields) | |
addFieldToFilter ($field, $condition=null) | |
reset () | |
Data Fields | |
const | SORT_ORDER_ASC = 'ASC' |
const | SORT_ORDER_DESC = 'DESC' |
Interface MapperInterface
Definition at line 11 of file MapperInterface.php.
addExpressionFieldToSelect | ( | $alias, | |
$expression, | |||
$fields | |||
) |
Add attribute expression (SUM, COUNT, etc) Example: ('sub_total', 'SUM({{attribute}})', 'revenue') Example: ('sub_total', 'SUM({{revenue}})', 'revenue') For some functions like SUM use groupByAttribute.
string | $alias | |
string | $expression | |
array | string | $fields |
Implemented in AbstractMapper.
addFieldToFilter | ( | $field, | |
$condition = null |
|||
) |
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']];The above would find where age equal to 42 OR name like Mage%.
string | array | $field | |
string | int | array | $condition |
Implemented in AbstractMapper.
getResource | ( | ) |
Get resource instance
Implemented in AbstractMapper.
map | ( | \Magento\Framework\Api\CriteriaInterface | $criteria | ) |
reset | ( | ) |
const SORT_ORDER_ASC = 'ASC' |
Definition at line 13 of file MapperInterface.php.
const SORT_ORDER_DESC = 'DESC' |
Definition at line 15 of file MapperInterface.php.