本文整理汇总了PHP中Student::getType方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::getType方法的具体用法?PHP Student::getType怎么用?PHP Student::getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student::getType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showForStudent
public function showForStudent(Student $student, $term)
{
if ($student->getType() != TYPE_FRESHMEN && $student->getType() != TYPE_TRANSFER) {
return false;
}
// Application term must be in the future
if ($student->getApplicationTerm() <= Term::getCurrentTerm()) {
return false;
}
$sem = substr($term, 4, 2);
if ($sem != TERM_SUMMER1 && $sem != TERM_SUMMER2 && $sem != TERM_FALL) {
return false;
}
return true;
}
示例2: populateSharedFields
private function populateSharedFields($term, Student $student)
{
$this->app->setTerm($term);
$this->app->setBannerId($student->getBannerId());
$this->app->setUsername($student->getUsername());
$this->app->setGender($student->getGender());
$this->app->setStudentType($student->getType());
$this->app->setApplicationTerm($student->getApplicationTerm());
$doNotCall = $this->context->get('do_not_call');
$areaCode = $this->context->get('area_code');
$exchange = $this->context->get('exchange');
$number = $this->context->get('number');
/* Phone Number */
/*
if(is_null($doNotCall)){
//test('ohh hai',1);
// do not call checkbox was not selected, so check the number
if(is_null($areaCode) || is_null($exchange) || is_null($number)){
throw new InvalidArgumentException('Please provide a cell-phone number or click the checkbox stating that you do not wish to share your number with us.');
}
}
*/
if (is_null($doNotCall)) {
$this->app->setCellPhone($areaCode . $exchange . $number);
} else {
$this->app->setCellPhone(null);
}
/* Meal Plan */
$mealOption = $this->context->get('meal_option');
if (!isset($mealOption)) {
//throw new InvalidArgumentException('Missing meal option from context.');
}
$this->app->setMealPlan($mealOption);
/* Emergency Contact */
$this->app->setEmergencyContactName($this->context->get('emergency_contact_name'));
$this->app->setEmergencyContactRelationship($this->context->get('emergency_contact_relationship'));
$this->app->setEmergencyContactPhone($this->context->get('emergency_contact_phone'));
$this->app->setEmergencyContactEmail($this->context->get('emergency_contact_email'));
/* Missing Persons */
$this->app->setMissingPersonName($this->context->get('missing_person_name'));
$this->app->setMissingPersonRelationship($this->context->get('missing_person_relationship'));
$this->app->setMissingPersonPhone($this->context->get('missing_person_phone'));
$this->app->setMissingPersonEmail($this->context->get('missing_person_email'));
/* Medical Conditions */
$this->app->setEmergencyMedicalCondition($this->context->get('emergency_medical_condition'));
/* Special Needs */
$specialNeeds = $this->context->get('special_needs');
isset($specialNeeds['physical_disability']) ? $this->app->setPhysicalDisability(true) : null;
isset($specialNeeds['psych_disability']) ? $this->app->setPsychDisability(true) : null;
isset($specialNeeds['gender_need']) ? $this->app->setGenderNeed(true) : null;
isset($specialNeeds['medical_need']) ? $this->app->setMedicalNeed(true) : null;
if ($student->isInternational()) {
$this->app->setInternational(true);
} else {
$this->app->setInternational(false);
}
}
示例3: assignStudent
/**
* Does all the checks necessary to assign a student and makes the assignment
*
* The $room_id and $bed_id fields are optional, but one or the other must be specificed
*
* @param Student $student
* @param Integer $term
* @param Integer $room_id
* @param Integer $bed_id
* @param Integer $meal_plan
* @param String $notes
* @param boolean $lottery
* @param string $reason
* @throws InvalidArgumentException
* @throws AssignmentException
* @throws DatabaseException
* @throws Exception
*/
public static function assignStudent(Student $student, $term, $room_id = NULL, $bed_id = NULL, $meal_plan, $notes = "", $lottery = FALSE, $reason)
{
/**
* Can't check permissions here because there are some student-facing commands that needs to make assignments (e.g.
* the lottery/re-application code)
*
* if(!UserStatus::isAdmin() || !Current_User::allow('hms', 'assignment_maintenance')) {
* PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
* throw new PermissionException('You are not allowed to edit student assignments.');
* }
*/
PHPWS_Core::initModClass('hms', 'HMS_Residence_Hall.php');
PHPWS_Core::initModClass('hms', 'HMS_Floor.php');
PHPWS_Core::initModClass('hms', 'HMS_Room.php');
PHPWS_Core::initModClass('hms', 'HMS_Bed.php');
PHPWS_Core::initModClass('hms', 'HMS_Activity_Log.php');
PHPWS_Core::initModClass('hms', 'BannerQueue.php');
PHPWS_Core::initModClass('hms', 'AssignmentHistory.php');
PHPWS_Core::initModClass('hms', 'exception/AssignmentException.php');
$username = $student->getUsername();
// Make sure a username was entered
if (!isset($username) || $username == '') {
throw new InvalidArgumentException('Bad username.');
}
$username = strtolower($username);
if ($student->getType() == TYPE_WITHDRAWN) {
throw new AssignmentException('Invalid student type. Student is withdrawn.');
}
if (HMS_Assignment::checkForAssignment($username, $term)) {
throw new AssignmentException('The student is already assigned.');
}
if (isset($bed_id)) {
// A bed_id was given, so create that bed object
$vacant_bed = new HMS_Bed($bed_id);
if (!$vacant_bed) {
throw new AssignmentException('Null bed object.');
}
// Get the room that this bed is in
$room = $vacant_bed->get_parent();
} else {
if (isset($room_id)) {
// A room_id was given, so create that room object
$room = new HMS_Room($room_id);
// And find a vacant bed in that room
$beds = $room->getBedsWithVacancies();
$vacant_bed = $beds[0];
} else {
// Both the bed and room IDs were null, so return an error
throw new AssignmentException('No room nor bed specified.');
}
}
if (!$room) {
throw new AssignmentException('Null room object.');
}
// Make sure the room has a vacancy
if (!$room->has_vacancy()) {
throw new AssignmentException('The room is full.');
}
// Make sure the room is not offline
if ($room->offline) {
throw new AssignmentException('The room is offline');
}
// Double check that the bed is in the same term as we're being requested to assign for
if ($vacant_bed->getTerm() != $term) {
throw new AssignmentException('The bed\'s term and the assignment term do not match.');
}
// Double check that the resulting bed is empty
if ($vacant_bed->get_number_of_assignees() > 0) {
throw new AssignmentException('The bed is not empty.');
}
// Issue a warning if the bed was reserved for room change
//TODO Move this to the room change view
/*
if ($vacant_bed->room_change_reserved != 0) {
NQ::simple('hms', hms\NotificationView::WARNING, 'Room was reserved for room change');
}
*/
// Check that the room's gender and the student's gender match
$student_gender = $student->getGender();
if (is_null($student_gender)) {
throw new AssignmentException('Student gender is null.');
}
//.........这里部分代码省略.........
示例4: getRequiredApplicationTermsForStudent
/**
* Returns an array of term which the student *must* apply for.
*
* @param Student $student
*
* @return multitype:|multitype:Ambigous <multitype:multitype:number, multitype:multitype:number unknown multitype:number string >
*/
public static function getRequiredApplicationTermsForStudent(Student $student)
{
// Special case for Transfer students: They're not required to apply for any term
if ($student->getType() == TYPE_TRANSFER) {
return array();
}
$availableTerms = self::getAvailableApplicationTermsForStudent($student);
$requiredTerms = array();
foreach ($availableTerms as $term) {
if ($term['required'] == 1) {
$requiredTerms[] = $term;
}
}
return $requiredTerms;
}