开发者

Using doctrines findBy/getBy magic methods with the pager object?

开发者 https://www.devze.com 2023-01-16 23:40 出处:网络
Is it possible to use doctrines magic methods (in this case findBy*) with sfDoctrinePager?I\'m getting the following error:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消