1

While compiling a filter-set for a repository search criteria, I was wondering if I can make use of all known Magento 1 methods or if there are any differences.

Where are theses defined in the code (if), is there some kind of list maybe?

1 Answer 1

5

In Magento 2.1.0 I was able to spot a list of filter criteria within the API inside a comment (file: vendor/magento/framework/Api/CriteriaInterface.php:39)

 * - ["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]

The file comment has more information. Link to the public repository on Github:

Alan Storm has a higher-level introduction into the topic as well:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.