zend framework2 - How can I use > and < operation in zf2 doctrine custom repository -


i want run

$qry = $qb2->where("n2.userfk!=0 , n2.id >1 <20")  

in doctrine repository not working. giving error > , < operators.

use expressions:

$expr = $qb2->expr(); $qry = $qb2->andwhere(     $expr->neq('n2.userfk', 0)     $expr->andx(         $expr->gt('n2.id', 1),         $expr->lt('n2.id', 20)     ) ); 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -