Interface CriteriaInterface
Definition at line 11 of file CriteriaInterface.php.
◆ addField()
addField |
( |
|
$field, |
|
|
|
$alias = null |
|
) |
| |
Add field to select
- Parameters
-
string | array | $field | |
string | null | $alias | |
- Returns
- void
Implemented in AbstractCriteria.
◆ addFilter()
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:
- ["from" => $fromValue, "to" => $toValue]
- ["eq" => $equalValue]
- ["neq" => $notEqualValue]
- ["like" => $likeValue]
- ["in" => [$inValues]]
- ["nin" => [$notInValues]]
- ["notnull" => $valueIsNotNull]
- ["null" => $valueIsNull]
- ["moreq" => $moreOrEqualValue]
- ["gt" => $greaterValue]
- ["lt" => $lessValue]
- ["gteq" => $greaterOrEqualValue]
- ["lteq" => $lessOrEqualValue]
- ["finset" => $valueInSet]
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%.
- Parameters
-
string | $name | |
string | array | $field | |
string | int | array | $condition | |
string | $type | |
- Exceptions
-
Implemented in AbstractCriteria.
◆ addOrder()
addOrder |
( |
|
$field, |
|
|
|
$direction = self::SORT_ORDER_DESC , |
|
|
|
$unShift = false |
|
) |
| |
self::setOrder() alias
- Parameters
-
string | $field | |
string | $direction | |
bool | $unShift | |
- Returns
- void
Implemented in AbstractCriteria.
◆ getCriteriaList()
Get Criteria objects added to current Composite Criteria
- Returns
- \Magento\Framework\Api\CriteriaInterface[]
Implemented in AbstractCriteria.
◆ getFilters()
◆ getLimit()
◆ getMapperInterfaceName()
getMapperInterfaceName |
( |
| ) |
|
Get associated Mapper Interface name
- Returns
- string
Implemented in AbstractCriteria.
◆ getOrders()
◆ getPart()
getPart |
( |
|
$name, |
|
|
|
$default = null |
|
) |
| |
Retrieve criteria part
- Parameters
-
string | $name | |
mixed | $default | |
- Returns
- mixed
Implemented in AbstractCriteria.
◆ removeAllFields()
◆ removeAllFilters()
◆ removeField()
removeField |
( |
|
$field, |
|
|
|
$isAlias = false |
|
) |
| |
Removes field from select
- Parameters
-
string | null | $field | |
bool | $isAlias | Alias identifier |
- Returns
- void
Implemented in AbstractCriteria.
◆ removeFilter()
◆ reset()
◆ setLimit()
setLimit |
( |
|
$offset, |
|
|
|
$size |
|
) |
| |
◆ toArray()
Return all criteria parts as array
- Returns
- array
Implemented in AbstractCriteria.
◆ PART_CRITERIA_LIST
const PART_CRITERIA_LIST = 'criteria_list' |
◆ PART_FIELDS
const PART_FIELDS = 'fields' |
◆ PART_FILTERS
const PART_FILTERS = 'filters' |
◆ PART_LIMIT
const PART_LIMIT = 'limit' |
◆ PART_ORDERS
const PART_ORDERS = 'orders' |
◆ SORT_ORDER_ASC
const SORT_ORDER_ASC = 'ASC' |
◆ SORT_ORDER_DESC
const SORT_ORDER_DESC = 'DESC' |
The documentation for this interface was generated from the following file: