I want to run
$qry = $qb2->where("n2.userFk!=0 AND n2.id >1 <20")
in doctrine repository but it is not working. It is giving error for >
and <
operators.
答案 0 :(得分:0)
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)
)
);