Como usar andWhere e orWhere in Doctrine?

WHERE a = 1 AND (b = 1 Or b = 2) AND (c = 1 OR c = 2)

Como posso fazer isso no Doctrine?

$q->where("a = 1");
$q->andWhere("b = 1")
$q->orWhere("b = 2")
$q->andWhere("c = 1")
$q->orWhere("d = 2")

isso não está correto ... Deve ser:

$q->where("a = 1");
$q->andWhere("b = 1")
   $q->orWhere("b = 2")
$q->andWhere("c = 1")
   $q->orWhere("d = 2")

mas como posso fazer isso? Em Propel é function getNewCriterion, e em Doutrina ...?

questionAnswers(8)

yourAnswerToTheQuestion