views:

36

answers:

1

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::offset()

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.

A: 

nope, you can't. the findby* methods returns an object or an array of objects. sfDoctrinePager can only work on query objects.

Oren Mazor