2010-09-20 79 views
0

有没有可能使用sfDoctrinePager的教条魔术方法(在这种情况下findBy *)?我收到以下错误:使用派生物对象的学说findBy/getBy魔术方法?

Call to undefined method Doctrine_Collection::offset() 

下面是代码:

$this->pager->setQuery(Doctrine::getTable('notification')->findByUserId($this->getUser()->getGuardUser()->getId())); 

我知道我可以生成一个查询自己只是想知道,如果它使用的“神奇”的方法是可能的。

回答

1

不可以。 findby *方法返回一个对象或一个对象数组。 sfDoctrinePager只能在查询对象上工作。