sfGuard 和 propel 寻呼机
我希望能够使用 sfGuard 的用户表来使用 sfPropelPager。
我可以很好地执行以下操作:
$c = new Criteria();
$c->addAscendingOrderByColumn(sfGuardUserPeer::CREATED_AT);
$this->users = sfGuardUserPeer::doSelect($c);
但我不能执行以下操作:
$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;
我在这里做了一些非常愚蠢的事情吗?
I would like to be able to user sfPropelPager with sfGuard's user table.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经有一段时间没有使用 propel 了,但我记得,你应该将类名放在构造函数中,而不是表名 - 所以不要使用
sf_guard_user
尝试使用sfGuardUser
代码>.该类本身位于plugins/sfGuardPlugin/lib/model
中。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 withsfGuardUser
. The class itself is inplugins/sfGuardPlugin/lib/model
.