Which is the right way to add WHERE clauses to a sfDoctrinePager object?
I've tried in several ways but it seems that the parameters are not passed correctly.
Thank you for your help.
$count = $pForCount->count(sfDoctrine::getTable($this->getClass()));
$p = new sfDoctrinePager('myClass', 10);
$p->getQuery()->addWhere('foo = ?', 'bar');
$p->init();
"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"
$count = $pForCount->count(sfDoctrine::getTable($this->getClass()));
$count = $pForCount->count(sfDoctrine::getTable($this->getClass()), $pForCount->getParams());
Users browsing this forum: No registered users and 3 guests