开发者

sfGuard and propel pager

开发者 https://www.devze.com 2023-03-26 06:52 出处:网络
I would like to be able to user sfPropelPager with sfGuard\'s user ta开发者_运维知识库ble. I can do the following just fine:

I would like to be able to user sfPropelPager with sfGuard's user ta开发者_运维知识库ble.

I can do the following just fine:

$c = new Criteria();
$c->addAscendingOrderByColumn(sfGuardUserPeer::CREATED_AT);
$this->users = sfGuardUserPeer::doSelect($c);

But I cannot do:

$pager = new sfPropelPager('sf_guard_user', 20);
$pager->setPage($this->getRequestParameter('page', 1));

$c = new Criteria();
$c->addAscendingOrderByColumn(sfGuardUserPeer::CREATED_AT);

$pager->setCriteria($c);
$pager->setPeerMethod('doSelect');
$pager->init();
$this->users = $pager;

Am I doing something painfully stupid here?


I haven't used propel for a while, but as I remember, you should put the class name in the constructor, not the table name - so instead of sf_guard_user try it with sfGuardUser. The class itself is in plugins/sfGuardPlugin/lib/model.

0

精彩评论

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