本文整理汇总了PHP中sfPropelPager::getPage方法的典型用法代码示例。如果您正苦于以下问题:PHP sfPropelPager::getPage方法的具体用法?PHP sfPropelPager::getPage怎么用?PHP sfPropelPager::getPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfPropelPager
的用法示例。
在下文中一共展示了sfPropelPager::getPage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateWithLinkToRemote
private function generateWithLinkToRemote($page, $linkName)
{
sfProjectConfiguration::getActive()->loadHelpers('Javascript');
return link_to_remote($linkName, array('url' => "{$this->baseUrl}&page={$page}", 'update' => $this->linkToRemoteElementId), array('class' => $page == $this->pager->getPage() ? 'active' : ''));
}
示例2: evaluateCareerSchoolYearStudent
public function evaluateCareerSchoolYearStudent(CareerSchoolYear $career_school_year, Student $student, PropelPDO $con = null)
{
$con = is_null($con) ? Propel::getConnection() : $con;
// obtenemos las materias de este año
#$course_subject_students = CourseSubjectStudentPeer::retrieveByCareerSchoolYearAndStudent($career_school_year, $student, $con);
$c = CourseSubjectStudentPeer::retrieveCriteriaByCareerSchoolYearAndStudent($career_school_year, $student, $con);
$pager = new sfPropelPager('CourseSubjectStudent', 100);
$pager->setCriteria($c);
$pager->init();
for ($i = 1; $i < $pager->getLastPage() + 1; $i++) {
$course_subject_students = $pager->getResults();
// para todas las materias cursadas este año
foreach ($course_subject_students as $course_subject_student) {
// obtenemos el resultado (aprobada o desaprobada) y la cerramos.
// para el caso de las aprobadas, se crea la mesa de examen final (StudentApprovedCareerSubject)
// de lo contrario, la inscripción a la mesa de examen (TODO)
$result = $course_subject_student->getCourseResult($con);
if (!is_null($result)) {
$result->close($con);
}
}
###Liberando memoria ###
CourseSubjectStudentPeer::clearInstancePool();
StudentApprovedCourseSubjectPeer::clearInstancePool();
StudentDisapprovedCourseSubjectPeer::clearInstancePool();
################################
$pager->setPage($pager->getPage() + 1);
$pager->init();
}
unset($pager);
unset($c);
}