什么是'moreq'过滤器类型别名?

时间:2010-05-21 20:19:05

标签: php sql orm magento

我正在寻找Magento的过滤选项(电子商务系统和带有扩展ORM系统的PHP Framekwork)。特别是addFieldToFilter方法。在此方法中,通过传入单个元素数组来指定SQLish过滤器,其中键指示过滤器的类型。例如,

array('eq'=>'bar') //eq means equal
array('neq'=>'bar') //neq means not equal

每个都会给你一个看似

的where子句
where field = 'bar'; 
where field != 'bar'; 

所以,在源代码的深处,我找到了一个名为

的比较类型
'moreq'

映射到> =比较运算符

array('moreq'=>'27')
where field >= 27

奇怪的是,已经存在'gteq'比较类型

array('gteq'=>'27')
where field >= 27

所以,我的问题是,moreq代表什么?是否有一些特殊的SQL概念在Magento想要映射到MySQL的其他数据库中得到支持,或者它只是“更需要”,并且是一个例子,当你做快速敏捷并试图保持向后兼容性时会发生什么。

1 个答案:

答案 0 :(得分:1)

我在比较运算符上为自己做了一些笔记,直接来自db集合抽象。如您所见,moreq是“大于或等于”。你是正确的,它是gteq的重复,但我没有在代码中看到任何暗示以前使用的东西:

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

希望有所帮助!

谢谢, 乔

相关问题