本文整理汇总了PHP中Student::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::getId方法的具体用法?PHP Student::getId怎么用?PHP Student::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
public static function getInstance(Student $a_student)
{
if (isset(self::$analyticals[$a_student->getId()])) {
return self::$analyticals[$a_student->getId()];
}
$behavior = ucwords(sfConfig::get("nc_flavor_flavors_current", "demo"));
$clazz = $behavior . "AnalyticalBehaviour";
return self::$analyticals[$a_student->getId()] = new $clazz($a_student);
}
示例2: retrieveCurrentForStudentCriteria
public static function retrieveCurrentForStudentCriteria(Student $student, Criteria $c = null)
{
$c = is_null($c) ? new Criteria() : $c;
$c->add(self::SCHOOL_YEAR_ID, SchoolYearPeer::retrieveCurrent()->getId());
$c->addJoin(self::ID, StudentCareerSchoolYearPeer::CAREER_SCHOOL_YEAR_ID);
$c->add(StudentCareerSchoolYearPeer::STUDENT_ID, $student->getId());
return $c;
}
示例3: contains
public function contains(Student $student)
{
foreach ($this->students as $s) {
if ($s->getId() == $student->getId()) {
return true;
}
}
return false;
}
示例4: executeNew
public function executeNew(sfWebRequest $request)
{
$programSectionId = $request->getParameter('sectionId');
$this->sectionDetail = Doctrine_Core::getTable('ProgramSection')->findOneById($programSectionId);
$this->forward404Unless($this->sectionDetail);
## New Form
$this->studentForm = new FrontendStudentForm();
if ($request->isMethod('POST')) {
$this->studentForm->bind($request->getParameter('studentform'));
if ($this->studentForm->isValid()) {
$formData = $this->studentForm->getValues();
$student = new Student();
$name = $formData['name'];
$fathersName = $formData['fathers_name'];
$grandfathersName = $formData['grandfathers_name'];
$motherName = $formData['mother_name'];
$dateOfBirth = $formData['date_of_birth'];
$sex = $formData['sex'];
$nationality = $formData['nationality'];
$birthLocation = $formData['birth_location'];
$residenceCity = $formData['residence_city'];
$residenceWoreda = $formData['residence_woreda'];
$residenceKebele = $formData['residence_kebele'];
$residenceHourseNumber = $formData['residence_house_number'];
$ethnicity = $formData['ethnicity'];
$telephone = $formData['telephone'];
$email = $formData['email'];
$student->setName($name);
$student->setFathersName($fathersName);
$student->setGrandfathersName($grandfathersName);
$student->setMotherName($motherName);
$student->setDateOfBirth($dateOfBirth);
$student->setSex($sex);
$student->setAdmissionYear(date('Y'));
$student->setNationality($nationality);
$student->setBirthLocation($birthLocation);
$student->setResidenceCity($residenceCity);
$student->setResidenceWoreda($residenceWoreda);
$student->setResidenceKebele($residenceKebele);
$student->setResidenceHouseNumber($residenceHourseNumber);
$student->setEthinicity($ethnicity);
$student->setTelephone($telephone);
$student->setEmail($email);
$student->save();
$enrollment = new EnrollmentInfo();
$enrollment->makeEnrollment(null, null, null, null, $programSectionId, sfConfig::get('app_transfer_enrollment'), $student->getId());
$auditlog = new AuditLog();
$auditlog->addNewLogInfo($this->getUser()->getAttribute('userId'), 'Performed Enrollment of Transfered Student');
$this->getUser()->setFlash('notice', 'Transfer Enrollment Was Successful ');
$this->redirect('transfer/sectiondetail/?id=' . $programSectionId);
} else {
$this->getUser()->setFlash('error', 'Error with Transfer Enrollment Form');
}
}
}
示例5: retrieveForStudentAndCareerSchoolYear
public static function retrieveForStudentAndCareerSchoolYear(Student $student, CareerSchoolYear $career_school_year, PropelPDO $con = null)
{
$con = is_null($con) ? Propel::getConnection() : $con;
$c = new Criteria();
$c->addJoin(self::COURSE_SUBJECT_STUDENT_ID, CourseSubjectStudentPeer::ID);
$c->add(CourseSubjectStudentPeer::STUDENT_ID, $student->getId());
$c->addJoin(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, CourseSubjectPeer::ID);
$c->addJoin(CourseSubjectPeer::CAREER_SUBJECT_SCHOOL_YEAR_ID, CareerSubjectSchoolYearPeer::ID);
$c->add(CareerSubjectSchoolYearPeer::CAREER_SCHOOL_YEAR_ID, $career_school_year->getId());
return self::doSelect($c, $con);
}
示例6: Student
function test_getId()
{
//Arrange
$name = "Joleen";
$enrollment = "8/25/2015";
$id = 1;
$test_student = new Student($name, $enrollment, $id);
//Act
$result = $test_student->getId();
//Assert
$this->assertEquals($id, $result);
}
示例7: Student
function test_student_getId()
{
//Arrange
$name = "Bobby";
$id = 1;
$enroll = "2015-10-10";
$test_student = new Student($name, $id, $enroll);
//Act
$result = $test_student->getId();
//Assert
$this->assertEquals(1, $result);
}
示例8: Student
function test_find()
{
$name = "Mike";
$enrollment_date = "2015-12-12";
$test_student = new Student($name, $enrollment_date);
$test_student->save();
$name2 = "The Same Exact Name";
$enrollment_date2 = "2015-12-12";
$test_student2 = new Student($name2, $enrollment_date2);
$test_student2->save();
$result = Student::find($test_student->getId());
$this->assertEquals($test_student, $result);
}
示例9: testFind
function testFind()
{
$name = "Bob";
$enrollment_date = "2015-01-01";
$test_student = new Student($name, $enrollment_date);
$test_student->save();
$name2 = "Kevin";
$enrollment_date2 = "2015-02-01";
$test_student2 = new Student($name, $enrollment_date);
$test_student2->save();
$result = Student::find($test_student->getId());
$this->assertEquals($test_student, $result);
}
示例10: testGetId
function testGetId()
{
$name = "Coding 101";
$enrollment_date = '0000-00-00';
$id = 1;
$test_course = new Course($name, $id);
$test_course->save();
$student_name = "Aladdin";
$course_id = $test_course->getId();
$test_student = new Student($student_name, $id, $enrollment_date, $course_id);
$result = $test_student->getId();
$this->assertEquals(1, $result);
}
示例11: Student
function test_find()
{
$student_name = "Abe Lincoln";
$enroll_date = "06-15-2015";
$test_student = new Student($student_name, $enroll_date);
$test_student->save();
$student_name2 = "George Washington";
$enroll_date2 = "05-30-2015";
$test_student2 = new Student($student_name2, $enroll_date2);
$test_student2->save();
$result = Student::find($test_student->getId());
$this->assertEquals($test_student, $result);
}
示例12: retrieveCriteriaRepprovedForStudentAndCareer
/**
* Counts the repproved course subjects for the given student and career.
*
* @param Student $student
* @param Career $career
* @param PropelPDO $con
* @return Criteria
*/
public static function retrieveCriteriaRepprovedForStudentAndCareer(Student $student, Career $career, PropelPDO $con = null)
{
$c = new Criteria();
$c->add(self::STUDENT_APPROVED_CAREER_SUBJECT_ID, null, Criteria::ISNULL);
$c->addJoin(self::COURSE_SUBJECT_STUDENT_ID, CourseSubjectStudentPeer::ID);
$c->add(CourseSubjectStudentPeer::STUDENT_ID, $student->getId());
$c->addJoin(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, CourseSubjectPeer::ID);
$c->addJoin(CourseSubjectPeer::CAREER_SUBJECT_SCHOOL_YEAR_ID, CareerSubjectSchoolYearPeer::ID);
$c->addJoin(CareerSubjectSchoolYearPeer::CAREER_SCHOOL_YEAR_ID, CareerSchoolYearPeer::ID);
$c->add(CareerSchoolYearPeer::CAREER_ID, $career->getId());
$excluded_subjects = SchoolBehaviourFactory::getEvaluatorInstance()->getExcludeRepprovedSubjects();
$c->add(CareerSchoolYearPeer::ID, $excluded_subjects, Criteria::NOT_IN);
return $c;
}
示例13: retrieveByDateAndStudent
public static function retrieveByDateAndStudent($date, Student $student, $course_subject_id, $career_school_year_id = null)
{
$c = new Criteria();
$c->add(self::DAY, $date);
$c->add(self::STUDENT_ID, $student->getId());
if (is_null($course_subject_id)) {
$c->add(self::COURSE_SUBJECT_ID, null, Criteria::ISNULL);
} else {
$c->add(self::COURSE_SUBJECT_ID, $course_subject_id);
}
if (!is_null($career_school_year_id)) {
$c->add(self::CAREER_SCHOOL_YEAR_ID, $career_school_year_id);
}
return self::doSelectOne($c);
}
示例14: retrieveCriteriaByCareerSchoolYearAndStudent
public static function retrieveCriteriaByCareerSchoolYearAndStudent(CareerSchoolYear $career_school_year, Student $student, PropelPDO $con = null, $approved = false)
{
if (is_null($con)) {
$con = Propel::getConnection();
}
$c = new Criteria();
$c->add(CareerSubjectSchoolYearPeer::CAREER_SCHOOL_YEAR_ID, $career_school_year->getId());
$c->addJoin(CourseSubjectPeer::CAREER_SUBJECT_SCHOOL_YEAR_ID, CareerSubjectSchoolYearPeer::ID);
$c->addJoin(CourseSubjectPeer::ID, self::COURSE_SUBJECT_ID);
$c->add(self::STUDENT_ID, $student->getId());
if ($approved) {
$c->add(self::STUDENT_APPROVED_COURSE_SUBJECT_ID, null, Criteria::ISNOTNULL);
}
$c->addGroupByColumn(self::COURSE_SUBJECT_ID);
return $c;
}
示例15: Department
function test_find()
{
//Arrange
$test_department = new Department("Biology", "346 Stupid Avenue");
$test_department->save();
$name = "Ashlin Aronin";
$enrollment_date = "2015-08-24";
$test_student = new Student($name, $enrollment_date, $test_department->getId());
$test_student->save();
$name2 = "John Nolastname";
$enrollment_date2 = "2015-07-20";
$test_student2 = new Student($name, $enrollment_date, $test_department->getId());
$test_student2->save();
//Act
$result = Student::find($test_student2->getId());
//Assert
$this->assertEquals($test_student2, $result);
}