本文整理匯總了PHP中PersonPeer::getCriteriaPager方法的典型用法代碼示例。如果您正苦於以下問題:PHP PersonPeer::getCriteriaPager方法的具體用法?PHP PersonPeer::getCriteriaPager怎麽用?PHP PersonPeer::getCriteriaPager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PersonPeer
的用法示例。
在下文中一共展示了PersonPeer::getCriteriaPager方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: executeMailingList
public function executeMailingList(sfWebRequest $request)
{
# security
if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Coordinator', 'Volunteer'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
# for navigation menu
sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
slot('nav_menu', array('mission_coord', ''));
$this->email_list = EmailListPeer::retrieveByPK($request->getParameter('id'));
$this->forward404Unless($this->email_list);
# filter
$c = new Criteria();
$c->addJoin(EmailListPersonPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
$c->add(EmailListPersonPeer::LIST_ID, $request->getParameter('id'));
$this->page = $request->getParameter('page', 1);
$this->max_array = array(5, 10, 20, 30);
if (in_array($request->getParameter('max'), $this->max_array)) {
$this->max = $request->getParameter('max');
} else {
$this->max = sfConfig::get('app_max_person_per_page', 10);
}
$this->pager = PersonPeer::getCriteriaPager($c, $this->max, $this->page);
$this->persons = $this->pager->getResults();
}