Is it possible to use doctrines magic methods (in this case findBy*) with sfDoctrinePager? I'm getting the following error:
Call to undefined method Doctrine_Collection::offs开发者_JS百科et()
Here is the code:
$this->pager->setQuery(Doctrine::getTable('notification')->findByUserId($this->getUser()->getGuardUser()->getId()));
I know I can build a query myself just want to know if it's possible using the "magic" methods.
nope, you can't. the findby* methods returns an object or an array of objects. sfDoctrinePager can only work on query objects.
精彩评论