当前位置: 首页>>代码示例>>PHP>>正文


PHP Student::getGender方法代码示例

本文整理汇总了PHP中Student::getGender方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::getGender方法的具体用法?PHP Student::getGender怎么用?PHP Student::getGender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Student的用法示例。


在下文中一共展示了Student::getGender方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct(Student $student1, Student $student2, $lifestyle, $earliestTime)
 {
     $this->student1 = $student1;
     $this->student2 = $student2;
     $this->lifestyle = $lifestyle;
     $this->gender = $student1->getGender();
     $this->earliestTime = $earliestTime;
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:8,代码来源:AssignmentPairing.php

示例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);
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:57,代码来源:ContextApplicationFactory.php

示例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.');
     }
//.........这里部分代码省略.........
开发者ID:jlbooker,项目名称:homestead,代码行数:101,代码来源:HMS_Assignment.php

示例4: Student

                    if (isset($_REQUEST["target"])) {
                        $target = $_REQUEST["target"];
                        $student = new Student($target);
                        $pageBody .= '
<table class="pretty">
<tr>
	<th>school ID</th>
	<td>' . $student->getSchoolID() . '</td>
</tr>
<tr>
	<th>name</th>
	<td>' . $student->getName() . '</td>
</tr>
<tr>
	<th>gender</th>
	<td>' . $genders[$student->getGender()] . '</td>
</tr>
<tr>
	<th>date registered</th>
	<td>' . $student->getDateOfAdmission() . '</td>
</tr>
</table>';
                    } else {
                        $pageBody .= '
<div class="dialog error">
<p>Sorry, but in order to view a students record, you must identify that student first, perhaps from <a href="?section=students&amp;action=list">here</a>?</p>
</div>';
                    }
                    break;
                case "list":
                default:
开发者ID:eebrah,项目名称:schoolsys,代码行数:31,代码来源:index.php


注:本文中的Student::getGender方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。