本文整理汇总了PHP中StudentPeer类的典型用法代码示例。如果您正苦于以下问题:PHP StudentPeer类的具体用法?PHP StudentPeer怎么用?PHP StudentPeer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StudentPeer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: configure
public function configure()
{
$student_id = $this->getOption('student_id');
$this->student = StudentPeer::retrieveByPK($student_id);
$this->career_school_year_id = $this->getOption('career_school_year_id');
$this->course_subject_id = $this->getOption('course_subject_id');
$this->division_id = $this->getOption('division_id');
$sf_formatter_attendance_week = new sfWidgetFormSchemaFormatterAttendanceWeek($this->getWidgetSchema());
$this->getWidgetSchema()->addFormFormatter("AttendanceWeek", $sf_formatter_attendance_week);
$this->getWidgetSchema()->setFormFormatterName('AttendanceWeek');
$day = $this->getOption('day');
$this->widgetSchema->setNameFormat('attendance_' . $student_id . '][%s]');
#student
$this->setWidget("student_id", new sfWidgetFormInputHidden());
$this->setValidator("student_id", new sfValidatorPropelChoice(array("model" => "Student", "required" => true)));
$this->setWidget("student", new mtWidgetFormPlain(array('object' => $this->student)));
for ($i = 0; $i <= 6; $i++) {
$day_i = date('Y-m-d', strtotime($day . '-' . $i . 'day a go'));
$student_attendance = StudentAttendancePeer::retrieveOrCreateByDateAndStudent($day_i, $this->student, $this->getOption('course_subject_id'));
if ($student_attendance) {
$this->setDefault("value_" . $i, $student_attendance->getAbsenceTypeId());
}
$this->setWidget("value_" . $i, $this->getAttendanceWidget());
$this->getWidget("value_" . $i, $this->getAttendanceWidget())->setAttribute('class', 'attendance_week_input');
$this->setValidator("value_" . $i, $this->getAttendanceValidator());
}
$this->setDefault("student_id", $student_id);
$this->disableCSRFProtection();
$this->course_subject = CourseSubjectPeer::retrieveByPK($this->course_subject_id);
$period = CareerSchoolYearPeriodPeer::retrieveByPK($this->course_subject->getCourse()->getCurrentPeriod());
$this->setWidget('period', new mtWidgetFormPartial(array('module' => 'student_attendance', 'partial' => 'totalAbsences', 'form' => $this, 'parameters' => array('career_school_year_id' => $this->career_school_year_id, 'period' => $period, 'course_subject_id' => $this->course_subject_id, 'student' => $this->student))));
$this->getWidgetSchema()->moveField('period', sfWidgetFormSchema::LAST);
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:33,代码来源:StudentAttendanceSubjectWeekForm.php
示例2: validate
function validate($validator, $values)
{
$student_ids = $values['division_student_list'];
$result = true;
$msg = 'No se pudieron hacer las inscripciones por que surgieron algunos errores.';
$msg .= '<ul>';
if (!is_null($student_ids)) {
foreach ($student_ids as $student_id) {
$student = StudentPeer::retrieveByPk($student_id);
if ($student->isRegistered() && !is_null($student->isRegisteredInCareer($this->getObject()->getCareer()))) {
foreach ($this->getObject()->getCourses() as $course) {
if (!$student->hasApprovedCorrelativesForCourse($course)) {
$result = false;
$msg .= '<li>El alumno ' . $student . ' no puede cursar: ' . $course . ' por que no tiene las correlativas necesarias. </li>';
}
}
} else {
$result = false;
$msg .= '<li>El alumno ' . $student . ' no se encuentra inscripto en la carrera o en el año lectivo. </li>';
}
}
$msg .= '</ul>';
if (!$result) {
throw new sfValidatorError($validator, $msg);
}
}
return $values;
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:28,代码来源:DivisionStudentInscriptionForm.class.php
示例3: doSelectByStudent
public static function doSelectByStudent(Criteria $criteria, $con = null)
{
$usertype = sfContext::getInstance()->getUser()->getAttribute('usertype', 'common', 'bo');
$student = null;
$student_id = null;
if ($usertype == 'student') {
$student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$student = StudentPeer::retrieveByPK($student_id);
}
if ($student == null) {
$student_id = sfContext::getInstance()->getRequest()->getParameter('student_id');
$student = StudentPeer::retrieveByPK($student_id);
}
$criteria->add(StudentPeer::CURRICULUM_ID, $student->getCurriculumId());
$criteria->addJoin(StudentPeer::CURRICULUM_ID, CurriculumPeer::ID);
$criteria->addJoin(CurriculumPeer::DEPARTMENT_ID, DepartmentPeer::ID);
$tmp_depts = DepartmentPeer::doSelect($criteria);
$depts = array();
foreach ($tmp_depts as $key => $val) {
$pi = $val->getParentalIndex();
$prefix = '';
for ($i = 0; $i < $val->level - 1; $i++) {
$prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue();
}
$val->setdescription($prefix . $val->getDescription());
$val->setCode($prefix . $val->getCode());
$depts[$pi] = $val;
}
ksort($depts);
$result = array();
foreach ($depts as $r) {
$result[] = $r;
}
return $result;
}
开发者ID:taryono,项目名称:school,代码行数:35,代码来源:DepartmentPeer.php
示例4: executeGeneralInformation
public function executeGeneralInformation()
{
$this->current_school_year = SchoolYearPeer::retrieveCurrent();
$this->amount_sy_students = $this->current_school_year->countSchoolYearStudents();
$this->amount_teachers = TeacherPeer::doCount(new Criteria());
$this->amount_students = StudentPeer::doCount(new Criteria());
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:7,代码来源:components.class.php
示例5: getStudent
public function getStudent()
{
$c = new Criteria();
$c->add(StudentPeer::ID, $this->getPayer());
$student = StudentPeer::doSelectOne($c);
return $student;
}
开发者ID:taryono,项目名称:school,代码行数:7,代码来源:PaymentJournal.php
示例6: save
public function save($con = null)
{
if (!$this->isValid()) {
throw $this->getErrorSchema();
}
if (is_null($con)) {
$con = Propel::getConnection(CareerStudentPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
try {
$con->beginTransaction();
$values = $this->getValues();
$career = CareerPeer::retrieveByPK($values["career_id"]);
$orientation = OrientationPeer::retrieveByPK($values["orientation_id"]);
$sub_orientation = SubOrientationPeer::retrieveByPK($values["sub_orientation_id"]);
$start_year = $values["start_year"];
unset($values["career_id"]);
unset($values["orientation_id"]);
unset($values["sub_orientation_id"]);
unset($values["start_year"]);
foreach ($values as $student_id) {
$student = StudentPeer::retrieveByPk($student_id, $con);
if (!$student->isRegisteredToCareer($career, $con)) {
$student->registerToCareer($career, $orientation, $sub_orientation, $start_year, $con);
}
}
$con->commit();
} catch (Exception $e) {
$con->rollBack();
throw $e;
}
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:31,代码来源:MultipleCareerRegistrationForm.class.php
示例7: areAllFromSameStudent
/**
* This method check if all the student_attendance_ids are for the same student.
*
* @param <array> $student_attendance_ids
* @return boolean
*/
public static function areAllFromSameStudent($student_attendance_ids)
{
$c = new Criteria();
$c->add(self::ID, $student_attendance_ids, Criteria::IN);
$c->addJoin(self::STUDENT_ID, StudentPeer::ID);
return StudentPeer::doCount($c) == 1;
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:13,代码来源:StudentAttendancePeer.php
示例8: save
public function save($con = null)
{
if (!$this->isValid()) {
throw $this->getErrorSchema();
}
if (is_null($con)) {
$con = Propel::getConnection();
}
try {
$con->beginTransaction();
$values = $this->getValues();
$school_year = SchoolYearPeer::retrieveByPK($values["school_year_id"]);
$shift = ShiftPeer::retrieveByPK($values["shift_id"]);
unset($values["school_year_id"]);
unset($values["shift_id"]);
foreach ($values as $student_id) {
$student = StudentPeer::retrieveByPk($student_id);
if (!$student->getIsRegistered($school_year)) {
$student->registerToSchoolYear($school_year, $shift, $con);
}
}
$con->commit();
} catch (Exception $e) {
$con->rollBack();
throw $e;
}
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:27,代码来源:MultipleSchoolYearRegistrationForm.class.php
示例9: canBeDeleted
public function canBeDeleted(PropelPDO $con = null)
{
$criteria = new Criteria();
$criteria->add(TutorPeer::OCCUPATION_ID, $this->getId());
$criteria2 = new Criteria();
$criteria2->add(StudentPeer::OCCUPATION_ID, $this->getId());
return !(StudentPeer::doCount($criteria2) || TutorPeer::doCount($criteria));
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:8,代码来源:Occupation.php
示例10: executeListByStudent
public function executeListByStudent()
{
$student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$student = StudentPeer::retrieveByPK($student_id);
$this->student = $student;
$this->forward404Unless($student);
$c = new Criteria();
$c->add(AcademicCalendarPeer::ID, $student->getAcademicCalendar()->getChildRecurs(), Criteria::IN);
$c->add(AcademicCalendarPeer::DEPARTMENT_ID, $student->getAcademicCalendar()->getDepartment()->getChildRecurs(), Criteria::IN);
$c->addJoin(AccalActivityPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
$c->addDescendingOrderByColumn(AccalActivityPeer::ID);
$this->sort($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(), 'accal_activity'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'accal_activity');
$pager = new sfPropelPager('AccalActivity', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'accal_activity'));
$this->getUser()->setAttribute('page', $page, 'accal_activity');
$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->actions = $actions;
$actions2 = array(array('name' => '<span>Tahun Ajaran 2011/2012</span>', 'url' => 'accal_activity/listByStudent', 'color' => 'sun', 'type' => 'direct'));
$this->actions2 = $actions2;
}
开发者ID:taryono,项目名称:school,代码行数:58,代码来源:actions.class.php
示例11: retrieveByStudentId
public static function retrieveByStudentId($student_id)
{
$c = new Criteria();
$student = StudentPeer::retrieveByPK($student_id);
$scsy = StudentCareerSchoolYearPeer::retrieveCareerSchoolYearForStudentAndYear($student, SchoolYearPeer::retrieveCurrent());
$c->add(self::STUDENT_CAREER_SCHOOL_YEAR_ID, $scsy[0]->getId());
$c->add(self::IS_DELETED, true, Criteria::EQUAL);
return self::doSelectOne($c);
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:9,代码来源:TentativeRepprovedStudentPeer.php
示例12: doSelectByStudentAll
public static function doSelectByStudentAll()
{
$student = StudentPeer::retrieveByPK(sfContext::getInstance()->getRequest()->getParameter('student_id'));
if (!$student) {
return array();
}
$c = new Criteria();
$c->add(VStudentCoursePeer::STUDENT_ID, $student->getId());
return VStudentCoursePeer::doSelect($c);
}
开发者ID:taryono,项目名称:school,代码行数:10,代码来源:VStudentCoursePeer.php
示例13: executeIndex
public function executeIndex()
{
$lekarSms = new lekarSms();
$students = StudentPeer::retrieveByPK('1');
echo '<pre>';
print_r($students);
echo '</pre>';
var_dump($students->getCode());
//sfLoader::loadHelpers(array('myHelper'));
}
开发者ID:taryono,项目名称:bm,代码行数:10,代码来源:actions.class.php
示例14: retrieveByCode
public static function retrieveByCode($member_code, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(StudentPeer::DATABASE_NAME);
$criteria->add(StudentPeer::CODE, $member_code);
$v = StudentPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
开发者ID:taryono,项目名称:school,代码行数:10,代码来源:StudentPeer.php
示例15: getAvailableStudentsForExaminationRepprovedSubject
public static function getAvailableStudentsForExaminationRepprovedSubject(ExaminationRepprovedSubject $examination_repproved_subject)
{
if ($examination_repproved_subject->getExaminationRepproved()->getExaminationType() == ExaminationRepprovedType::FREE_GRADUATED) {
$c = self::getFreeGraduatedStudentsCriteria($examination_repproved_subject);
} else {
$c = self::getAvailableForExaminationRepprovedSubjectCriteria($examination_repproved_subject);
}
$c->addJoin(CourseSubjectStudentPeer::STUDENT_ID, StudentPeer::ID, Criteria::INNER_JOIN);
return StudentPeer::doSelect($c);
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:10,代码来源:StudentRepprovedCourseSubjectPeer.php
示例16: doCountStudentsForCareerSchoolYearAndYear
public static function doCountStudentsForCareerSchoolYearAndYear($career_school_year, $year, $criteria = null)
{
$criteria = is_null($criteria) ? new Criteria() : $criteria;
$criteria->addJoin(self::STUDENT_ID, StudentPeer::ID);
$criteria->addJoin(StudentCareerSchoolYearPeer::STUDENT_ID, StudentPeer::ID);
$criteria->add(StudentCareerSchoolYearPeer::CAREER_SCHOOL_YEAR_ID, $career_school_year->getId());
//$criteria->add(StudentCareerSchoolYearPeer::YEAR, $year);
$criteria->add(DivisionPeer::YEAR, $year);
$criteria->setDistinct();
return StudentPeer::doCount($criteria);
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:11,代码来源:DivisionStudentPeer.php
示例17: getStudents
/**
* This method returns the students related with this examinationRepprovedSubject
*
* @return array Students[]
*/
public function getStudents()
{
$c = new Criteria();
$c->add(StudentExaminationRepprovedSubjectPeer::EXAMINATION_REPPROVED_SUBJECT_ID, $this->getId());
$c->addJoin(StudentExaminationRepprovedSubjectPeer::STUDENT_REPPROVED_COURSE_SUBJECT_ID, StudentRepprovedCourseSubjectPeer::ID);
$c->addJoin(StudentRepprovedCourseSubjectPeer::COURSE_SUBJECT_STUDENT_ID, CourseSubjectStudentPeer::ID);
$c->addJoin(CourseSubjectStudentPeer::STUDENT_ID, StudentPeer::ID);
$c->addJoin(StudentPeer::PERSON_ID, PersonPeer::ID);
$c->addAscendingOrderByColumn(PersonPeer::LASTNAME);
return StudentPeer::doSelect($c);
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:16,代码来源:ExaminationRepprovedSubject.php
示例18: doSave
public function doSave($con = null)
{
parent::doSave($con);
$student = StudentPeer::retrieveByPk($this->getValue('student_id'));
$career_school_year_period = CareerSchoolYearPeriodPeer::retrieveByPk($this->getValue('career_school_year_period_id'));
$student_career_school_year = StudentCareerSchoolYearPeer::getCurrentForStudentAndCareerSchoolYear($student, $career_school_year_period->getCareerSchoolYear());
$course_subject = CourseSubjectPeer::retrieveByPk($this->getValue('course_subject_id'));
$student_free = StudentFreePeer::retrieveByStudentCareerSchoolYearCareerSchoolYearPeriodAndCourse($student_career_school_year, $career_school_year_period, $course_subject);
$student_free->setIsFree(false);
$student_free->save($con);
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:11,代码来源:StudentReincorporationForm.class.php
示例19: preExecute
/**
* Redefines preExecute because this action CANT BE RISED WITHOUT A REFERENCE
*
*/
public function preExecute()
{
if (!$this->getUser()->getReferenceFor('student')) {
$this->getUser()->setFlash('warning', 'Debe seleccionar un estudiante para poder administrar las sanciones.');
$this->redirect('@student');
}
$this->student = StudentPeer::retrieveByPK($this->getUser()->getReferenceFor('student'));
if (is_null($this->student)) {
$this->getUser()->setFlash('warning', 'Debe seleccionar un estudiante para poder administrar las sanciones.');
$this->redirect('@student');
}
parent::preExecute();
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:17,代码来源:actions.class.php
示例20: sendSmsAttendance
public function sendSmsAttendance($student_code, $type, $time)
{
$connection = Propel::getConnection();
$query = "\n\t\t\tselect id as student_id from student where replace(code, '.', '') = '{$student_code}';\n\t\t";
$statement = $connection->prepareStatement($query);
$resultset = $statement->executeQuery();
$resultset->next();
$studentId = $resultset->getInt('student_id');
$student = StudentPeer::retrieveByPK($studentId);
$senderId = $this->getSenderId($student->getClassGroup()->getDepartmentId());
$prefix = $senderId->getText();
$date = date('j-M-Y', $time);
$hour = date('H:i', $time);
$recipients = array(array('type' => 'student', 'value' => $student->getId()));
if ($type == 'attend') {
$subject = 'Attend SMS ' . $student->getName() . ' - ' . $student->getClassGroup()->getName();
$message = $prefix . ' Alhamdulillah, Ananda ' . $student->getName() . ' telah hadir di sekolah pada tgl ' . $date . ' pkl ' . $hour;
} else {
if ($type == 'return') {
$subject = 'Return SMS ' . $student->getName() . ' - ' . $student->getClassGroup()->getName();
$message = $prefix . 'Ananda ' . $student->getName() . ' tlh selesai kbm di sekolah pd ' . $date . ' pkl ' . $hour;
$message .= '. Silahkan dijemput';
} else {
return;
}
}
$log = new SmsLog();
//$log->setCreatorUserId($employeeId);
$log->setCreatorType('system');
$log->setSubject($subject);
$log->setRecipient($this->jsonwrapper->json_encode($recipients));
$log->setMessage($message);
$log->setSenderId($senderId->getId());
$log->setCreated(date('Y-m-d H:i:s'));
$log->setSmsLong(1);
$log->setSmsCount(1);
$sendAt = date('Y-m-d H:i:s');
$log->setSendAt('now');
$log->save();
$recNumber = $student->getStudentDetail()->getCellphone();
$rec = new SmsLogRecipient();
$rec->setLogId($log->getId());
$rec->setRecipientId($student->getId());
$rec->setRecipientType('student');
$rec->setRecipientNumber($recNumber);
$rec->setStatus('pending');
$rec->setLog(0);
$rec->save();
/* Saving to gammu Database */
$save = $this->smsConn->send($rec->getId(), 1, 2, 3, $recNumber, $log->getMessage(), $log->getCreated(), $log->getSendAt());
}
开发者ID:taryono,项目名称:school,代码行数:51,代码来源:lekarSms.php
注:本文中的StudentPeer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论