本文整理汇总了PHP中ClassGroupPeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassGroupPeer::retrieveByPK方法的具体用法?PHP ClassGroupPeer::retrieveByPK怎么用?PHP ClassGroupPeer::retrieveByPK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassGroupPeer
的用法示例。
在下文中一共展示了ClassGroupPeer::retrieveByPK方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeEnquirer
public function executeEnquirer()
{
$this->applicant = $this->applicant;
$this->error = false;
$this->department = DepartmentPeer::retrieveByPK($this->applicant->getDepartment1());
$this->classGroup = ClassGroupPeer::retrieveByPK($this->applicant->getClassGroup1());
}
示例2: getParentalIndex
public function getParentalIndex()
{
$parentalIndex = "#" . str_pad($this->getId(), 3, '0', STR_PAD_LEFT);
$this->level = 1;
if ($this->getParent() !== null && $this->getParent() != 0) {
$p = ClassGroupPeer::retrieveByPK($this->getParent());
$parentalIndex = str_pad($p->getParentalIndex(), 3, '0', STR_PAD_LEFT) . "_" . $parentalIndex;
$this->level += $p->level;
}
$this->parentalIndex = $parentalIndex;
return $parentalIndex;
}
示例3: signInTestApplicant
public function signInTestApplicant($user)
{
$this->addCredential('bo');
$this->setAttribute('user_id', $user->getId(), 'bo');
$this->setAttribute('username_long', $user->getName(), 'bo');
$this->setAuthenticated2(true, 'bo');
$this->setAttribute('username', $user->getCode(), 'bo');
$this->setAttribute('department_id1', DepartmentPeer::retrieveByPK($user->getDepartment1())->getId(), 'bo');
$this->setAttribute('department1_name', DepartmentPeer::retrieveByPK($user->getDepartment1())->getName(), 'bo');
#$this->setAttribute('department_id2', $user->getDepartment2()? DepartmentPeer::retrieveByPK($user->getDepartment2())->getId() : '', 'bo');
#$this->setAttribute('department2_name', $user->getDepartment2()? DepartmentPeer::retrieveByPK($user->getDepartment2())->getName() : '', 'bo');
$this->setAttribute('class_name1', ClassGroupPeer::retrieveByPK($user->getClassGroup1())->getName(), 'bo');
$this->setAttribute('class_parent1', ClassGroupPeer::retrieveByPK($user->getClassGroup1())->getParentName(), 'bo');
#$this->setAttribute('class_name2', $user->getClassGroup2()? ClassGroupPeer::retrieveByPK($user->getClassGroup2())->getName() : '', 'bo');
#$this->setAttribute('class_parent2', $user->getClassGroup2()? ClassGroupPeer::retrieveByPK($user->getClassGroup2())->getParentName() : '', 'bo');
$this->setAttribute('login_time', time(), 'bo');
}
示例4: executeGetCourseByAccal
public function executeGetCourseByAccal()
{
$accal_id = $this->getRequestParameter('accal_id');
$accal = AcademicCalendarPeer::retrieveByPK($accal_id);
#$this->forward404Unless($accal);
$class_id = $this->getRequestParameter('class_id');
$class = ClassGroupPeer::retrieveByPK($class_id);
#$this->forward404Unless($class);
$c = new Criteria();
$c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_id, Criteria::IN);
$c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $accal_id, Criteria::IN);
$c->add(CourseSchedulePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
$c->add(CourseSchedulePeer::SUBJECT_CURR_ID, 316, Criteria::NOT_IN);
$objs = CourseSchedulePeer::doSelect($c);
$subjects = array();
foreach ($objs as $o) {
$subjects[$o->getId()] = $o->getSubjectCurr()->getSubject()->getName();
}
$this->content = $subjects;
$this->setTemplate('buildOptions');
}
示例5: doSelectByClassGroup2
public static function doSelectByClassGroup2()
{
$ta_id = sfContext::getInstance()->getRequest()->getParameter('id');
$ta = TestApplicantPeer::retrieveByPK($ta_id);
if ($ta == null) {
return array();
}
if ($ta->getClassGroup2() != null) {
$dept_id = ClassGroupPeer::retrieveByPK($ta->getClassGroup2())->getDepartmentId();
$c = new Criteria();
$c->addJoin(RegPeriodPeer::ID, RegTestPeriodPeer::REG_PERIOD_ID);
$c->addJoin(AcademicCalendarPeer::ID, RegPeriodPeer::ACADEMIC_CALENDAR_ID);
$c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept_id);
$objs = RegTestPeriodPeer::doSelect($c);
return $objs;
}
}
示例6: doSelectByClassGroup1
public static function doSelectByClassGroup1()
{
$ta_id = sfContext::getInstance()->getRequest()->getParameter('id');
$ta = TestApplicantPeer::retrieveByPK($ta_id);
if ($ta == null) {
return array();
}
$dept_id = ClassGroupPeer::retrieveByPK($ta->getClassGroup1())->getDepartmentId();
$c = new Criteria();
$c->add(LocationPeer::DEPARTMENT_ID, $dept_id);
$objs = LocationPeer::doSelect($c);
return $objs;
}
示例7: filterStudent
public function filterStudent($c, $filters)
{
$filters_key = array_keys($filters);
foreach ($filters_key as $key) {
$value = $filters[$key];
if ($value == '' || $value == null) {
continue;
}
if ($key == 'DEPARTMENT_ID') {
$c->addJoin(AcademicCalendarPeer::ID, StudentPeer::ACADEMIC_CALENDAR_ID);
$c->addJoin(DepartmentPeer::ID, AcademicCalendarPeer::DEPARTMENT_ID);
$column = DepartmentPeer::getTableMap()->getColumn('ID');
} elseif ($key == 'CLASS_NAME') {
$c->addJoin(ClassGroupPeer::ID, StudentPeer::CLASS_GROUP_ID);
$column = ClassGroupPeer::getTableMap()->getColumn('NAME');
} elseif ($key == 'ABSENCE') {
$column = StudentPeer::getTableMap()->getColumn('CLASS_NAME');
} else {
$column = StudentPeer::getTableMap()->getColumn($key);
}
$name = $column->getFullyQualifiedName();
$creoleType = $column->getCreoleType();
if ($creoleType == CreoleTypes::TIMESTAMP) {
$from = $value['from'];
$to = $value['to'];
if ($from != '' && $from != null) {
$c->add($name, $from, Criteria::GREATER_EQUAL);
}
if ($to != '' && $to != null) {
$c->add($name, $to, Criteria::LESS_EQUAL);
}
} else {
if ($creoleType == CreoleTypes::INTEGER) {
if ($name == StudentPeer::CLASS_GROUP_ID) {
$cg = ClassGroupPeer::retrieveByPK($value);
$c->add($name, $cg->getChildRecurs(), Criteria::IN);
} else {
$c->add($name, $value, Criteria::EQUAL);
}
} else {
if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) {
$c->add($name, "%{$value}%", Criteria::LIKE);
}
}
}
}
}
示例8: executeGetListForCourse
public function executeGetListForCourse()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$cr = new Criteria();
$academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
$class_group_id = $this->getRequestParameter('class_group_id');
$accal = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
$class = ClassGroupPeer::retrieveByPK($class_group_id);
$cr->add(VCourseSchedulePeer::ACADEMIC_CALENDAR_ID, $this->getRequestParameter('academic_calendar_id'));
$cr->add(VCourseSchedulePeer::CLASS_GROUP_ID, $this->getRequestParameter('class_group_id'));
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filterSubject($cr, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'course_schedule'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'course_schedule');
$pager = new sfPropelPager('VCourseSchedule', $rpp);
$pager->setCriteria($cr);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course_schedule'));
$this->getUser()->setAttribute('page', $page, 'course_schedule');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
$filter_string = "";
if ($this->filters) {
foreach ($this->filters as $key => $val) {
$filter_string .= "&filters[{$key}]={$val}";
}
$filter_string = preg_replace('/^&/', '', $filter_string);
}
$this->filter_string = $filter_string;
$this->subtitle = '';
$this->actions = $actions;
$this->academic_calendar_id = $academic_calendar_id;
$this->class_group_id = $class_group_id;
}
示例9:
</td>
</tr>
<tr>
<td style="text-align:left;">Nama Calon Murid</td>
<td style="text-align:center;">:</td>
<td style="text-align: justify;"><?php
echo $appl->getName();
?>
</td>
</tr>
<tr>
<td style="text-align:left;">Kelas</td>
<td style="text-align:center;">:</td>
<td style="text-align: justify;">
<?php
echo $appl->getClassGroup1() ? ClassGroupPeer::retrieveByPK($appl->getClassGroup1())->getName() . ' - ' . ClassGroupPeer::retrieveByPK($appl->getClassGroup1())->getParentName() : '-';
?>
</td>
</tr>
<tr>
<td style="text-align:left;">Asal Sekolah</td>
<td style="text-align:center;">:</td>
<td style="text-align: justify;">
<?php
echo $appl->getTestApplicantDetail()->getJobTitle() ? $appl->getTestApplicantDetail()->getJobTitle() : '-';
?>
</td>
</tr>
<?php
$i = 0;
示例10: elseif
++$i;
?>
"<?php
echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage();
?>
","<?php
echo $test_applicant->getCode();
?>
","<?php
echo $test_applicant->getName();
?>
","<?php
echo DepartmentPeer::retrieveByPK($test_applicant->getDepartment1())->toString();
?>
","<?php
echo ClassGroupPeer::retrieveByPK($test_applicant->getClassGroup1())->toString();
?>
","<?php
echo $test_applicant->getRegTestPeriod1() ? RegTestPeriodPeer::retrieveByPK($test_applicant->getRegTestPeriod1())->getRegPeriod()->getName() : '-';
?>
","<?php
if ($test_applicant->getApplicantType() == TestApplicant::STATUS_NEW) {
echo __('Baru');
} elseif ($test_applicant->getApplicantType() == TestApplicant::STATUS_TRANSFER) {
echo __('Pindahan');
} elseif ($test_applicant->getApplicantType() == TestApplicant::STATUS_EXTEND) {
echo __('Lanjutan');
}
?>
","<?php
echo $test_applicant->getYear();
示例11: getClassGroupRelatedByParent
public function getClassGroupRelatedByParent($con = null)
{
include_once 'lib/model/om/BaseClassGroupPeer.php';
if ($this->aClassGroupRelatedByParent === null && $this->parent !== null) {
$this->aClassGroupRelatedByParent = ClassGroupPeer::retrieveByPK($this->parent, $con);
}
return $this->aClassGroupRelatedByParent;
}
示例12: executeUpdate
public function executeUpdate()
{
$i18n = new sfI18N();
$i18n->initialize($this->getContext());
$i18n->setCulture($this->getUser()->getCulture());
$action_i18n = $i18n->globalMessageFormat->format('save as new');
$action_type = $this->getRequestParameter('action_type');
$subject_curr_id = $this->getRequestParameter('subject_curr_id');
$subject_curr = SubjectCurrPeer::retrieveByPK($subject_curr_id);
$this->forward404Unless($subject_curr);
$academic_calendar_id = $this->getRequestParameter('accal_id');
$academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
$this->forward404Unless($academic_calendar);
$class_group_id = $this->getRequestParameter('class_group_id');
$class_group = ClassGroupPeer::retrieveByPK($class_group_id);
$this->forward404Unless($class_group);
$course_sched = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
$this->forward404Unless($course_sched);
$cur13_term = Cur13TermPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($cur13_term);
$cur13_term->setCourseScheduleId($course_sched->getId());
$cur13_term->setCode($this->getRequestParameter('code'));
$cur13_term->setName($this->getRequestParameter('name'));
$cur13_term->setDescription($this->getRequestParameter('description'));
#$cur13_term->setCur13KiId($this->getRequestParameter('cur13_ki_id'));
$cur13_term->save();
$spkis = $this->getRequestParameter('spki');
$bobot = $this->getRequestParameter('bobot');
foreach ($spkis as $l => $spki) {
$ct = new Criteria();
$ct->add(Cur13TermSpecPeer::CUR13_TERM_ID, $cur13_term->getId());
$ct->add(Cur13TermSpecPeer::GRADE_SPEC_ID, $l);
$cur13_ts = Cur13TermSpecPeer::doSelectOne($ct);
if ($cur13_ts == null) {
$cur13_ts = new Cur13TermSpec();
}
$cur13_ts->setCur13TermId($cur13_term->getId());
$cur13_ts->setGradeSpecId($l);
$cur13_ts->setBobot($bobot[$l]);
$cur13_ts->save();
}
$delspkis = $this->getRequestParameter('delspki');
foreach ($delspkis as $l => $delspki) {
$ct = new Criteria();
$ct->add(Cur13TermSpecPeer::CUR13_TERM_ID, $cur13_term->getId());
$ct->add(Cur13TermSpecPeer::GRADE_SPEC_ID, $l);
$cur13_ts = Cur13TermSpecPeer::doSelectOne($ct);
if ($cur13_ts != null) {
$cur13_ts->delete();
}
}
return $this->redirect('cur13_term/getSubject?subject_curr_id=' . $subject_curr->getId() . '&accal_id=' . $academic_calendar->getId() . '&class_group_id=' . $class_group->getId());
}
示例13: executeSelectByClassGroup
public function executeSelectByClassGroup()
{
$class_id = $this->getRequestParameter('class_id');
$this->forward404Unless($class_id);
$class = ClassGroupPeer::retrieveByPK($class_id);
$dept_id = $class->getDepartmentId();
$objs = LocationPeer::doSelectByDepartment($dept_id);
$content = array();
$disabled = array();
foreach ($objs as $o) {
$content[$o->getId()] = $o->toStringWithCap();
if ($o->isSchedFull()) {
$disabled[] = $o->getId();
}
}
$this->content = $content;
$this->disabled = $disabled;
}
示例14: executeGetListCourse
public function executeGetListCourse()
{
$accal_id = $this->getRequestParameter('accal_id');
$accal = AcademicCalendarPeer::retrieveByPK($accal_id);
#$this->forward404Unless($accal);
$this->accal = $accal;
$this->accal_id = $accal_id;
$class_id = $this->getRequestParameter('class_id');
$class_group = ClassGroupPeer::retrieveByPK($class_id);
#$this->forward404Unless($class_group);
$this->class_group = $class_group;
$this->class_id = $class_id;
$c = new Criteria();
$c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $accal_id, Criteria::IN);
$c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_id, Criteria::IN);
$c->addJoin(VCourseDetailPeer::COURSE_SCHEDULE_ID, CourseSchedulePeer::ID);
#$this->sortCourse($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'course'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'course');
$pager = new sfPropelPager('VCourseDetail', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course'));
$this->getUser()->setAttribute('page', $page, 'course');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions2 = array(array('name' => 'filter', 'color' => 'white'));
$this->actions2 = $actions2;
}
示例15: executeUpdatePackaged
public function executeUpdatePackaged()
{
$student_id = $this->getRequestParameter('student_id');
$student = StudentPeer::retrieveByPK($student_id);
$this->forward404Unless($student);
$this->student = $student;
$academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
$academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
$this->forward404Unless($academic_calendar);
$class_group_id = $this->getRequestParameter('class_group_id');
$class_group = ClassGroupPeer::retrieveByPK($class_group_id);
$this->forward404Unless($class_group);
$status = $this->getRequestParameter('status');
$this->forward404Unless($status);
$subject_accals = $academic_calendar->getSubjectAccals();
$sas = array();
foreach ($subject_accals as $sa) {
if ($sa->getSubject()) {
$sas[] = $sa->getId();
}
}
$saved_sas = array();
$saved_student_courses = $student->getStudentCourses();
foreach ($saved_student_courses as $ssc) {
$saved_sas[] = $ssc->getSubjectAccalId();
}
$disabled_sa = array_intersect($sas, $saved_sas);
// calculate sc rules
$objs = SubjectAccalPeer::doSelectByAccal();
foreach ($objs as $o) {
$content[$o->getId()] = $o->toStringWithLector();
$c = new Criteria();
$c->add(SubjectAccalPeer::ID, $o->getId());
$c->add(SubjectCurrPeer::SUBJECT_ID, $o->getSubjectId());
$c->addJoin(AcademicCalendarPeer::ID, SubjectAccalPeer::ACADEMIC_CALENDAR_ID);
$c->addJoin(AcademicCalendarPeer::CURRICULUM_ID, SubjectCurrPeer::CURRICULUM_ID);
$c->addJoin(SubjectCurrPeer::ID, SubjectPrereqPeer::SUBCURR);
$sps = SubjectPrereqPeer::doSelect($c);
foreach ($sps as $sp) {
$s = $sp->getSubjectCurrRelatedBySubcurrPrereq()->getSubject();
// prereq subject must be in closed state
$c = new Criteria();
$c->add(SubjectAccalPeer::SUBJECT_ID, $s->getId());
$c->add(StudentCoursePeer::STUDENT_ID, $student_id);
$c->add(StudentCoursePeer::STATUS, StudentCourse::STATUS_CLOSED);
$c->addJoin(StudentCoursePeer::SUBJECT_ACCAL_ID, SubjectAccalPeer::ID);
$scs = StudentCoursePeer::doSelect($c);
$isPassGrade = false;
$isPassCredit = true;
$isPassIndex = true;
foreach ($scs as $sc) {
$grade = $sc->getFinalGrade();
$gc = GradeConversionPeer::retrieveByName($grade[0]);
// check prereq subject grade
if ($gc && $gc->getGrade() >= $sp->getGradeConversion()->getGrade()) {
$isPassGrade = true;
} else {
$isPassGrade = false;
}
// check credit requirement
if ($sp->getTotalCredit() > 0) {
if ($sc->getTotalCreditClosed() >= $sp->getTotalCredit()) {
$isPassCredit = true;
} else {
$isPassCredit = false;
}
}
// check index requirement
if ($sp->getPerformanceIndex() > 0) {
if ($sc->getPerformanceIndex() >= $sp->getPerformanceIndex()) {
$isPassIndex = true;
} else {
$isPassIndex = false;
}
}
}
$s0 = $sp->getSubjectCurrRelatedBySubcurrPrereq()->getSubject()->toString();
$s1 = $sp->getSubjectCurrRelatedBySubcurr()->getSubject()->toString();
if (!$isPassGrade || !$isPassCredit || !$isPassIndex) {
$disabled_sa[] = $o->getId();
}
}
}
$selected_sa = array_diff($sas, $disabled_sa);
foreach ($selected_sa as $sa_id) {
$student_course = new StudentCourse();
$student_course->setStudentId($student_id);
$student_course->setSubjectAccalId($sa_id);
$student_course->setStatus($status);
$student_course->setClassGroupId($class_group_id);
$student_course->save();
}
return $this->redirect('student_course_s/list?student_id=' . $student->getId());
}