What is the 'moreq' Filter Type an Alias for?
I'm looking in to Magento's filtering options (Ecommerce System and PHP Framekwork with an expansive ORM system). Specifically the addFieldToFilter
method. In this method, you specify a SQLish filter by passing in a single element array, with the key indicating the type of filter. For example,
array('eq'=>'bar') //eq means equal
array('neq'=>'bar') //neq means not equal
would each give you a where clause t开发者_如何学Chat looks like
where field = 'bar';
where field != 'bar';
So, deep in the bowels of the source, I found a comparison type named
'moreq'
that maps to a >= comparison operator
array('moreq'=>'27')
where field >= 27
The weird thing is, there's already a 'gteq' comparision type
array('gteq'=>'27')
where field >= 27
So, my question is, what does moreq stand for? Is is some special SQL concept that's supported in other databases that the Magento guys wants to map to MySQL, or is it just "more required" and an example what happens when you're doing rapid agile and trying to maintain backwards compatibility.
I took some notes for myself on the comparison operators, coming straight from the db collection abstraction. As you can see, moreq is for "greater than or equal to". You are correct that it is a duplicate for gteq, but I've not seen anything in the code that suggests a previous use:
from from
to to
= eq
!= neq
like like
not like nlike
in in
not in nin
is is
is not null notnull
is null null
>= moreq
> gt
< lt
>= gteq
<= lteq
find_in_set() finset
Hope that helps!
Thanks, Joe
精彩评论