4
如何编写查询像doctrine2逻辑或doctrine2 getRepository-> findBy()
SELECT * from table where field = value1 or field = value2
我发现像
$em->getRepository('myentitity')
->findBy(
array('field' => 'value1','field'=>'value2'), // $where
);
但我认为这是和..请建议me 谢谢
这将帮助:HTTPS://doctrine-orm.readthedocs.org/en/latest /reference/working-with-objects.html?highlight=getRepository –
@NiladriDas我已经看过那里,但不能得到我想要的 – alwaysLearn
请参阅条件运算符http://docs.doctrine-project.org/projects/doctrine-mongodb -odm/en/latest/reference/query-builder-api.html#conditional-operators你可以用'in'来查看这个页面http://stackoverflow.com/questions/9259089/doctrine-findby-with-或条件 –