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-或條件 –