當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Student::getName方法代碼示例

本文整理匯總了PHP中Student::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Student::getName方法的具體用法?PHP Student::getName怎麽用?PHP Student::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Student的用法示例。


在下文中一共展示了Student::getName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Student

 function test_update()
 {
     $name = "Chris";
     $date = "1111-11-11";
     $test_student = new Student($name, $date);
     $test_student->save();
     $new_name = "Chris the Jerk";
     $test_student->update($new_name);
     $this->assertEquals("Chris the Jerk", $test_student->getName());
 }
開發者ID:austinblanchard,項目名稱:university_registrar_switch,代碼行數:10,代碼來源:StudentTest.php

示例2: testGetName

 function testGetName()
 {
     //Arrange
     $name = "Student1";
     $test_student = new Student($name);
     //Act
     $result = $test_student->getName();
     //Assert
     $this->assertEquals($name, $result);
 }
開發者ID:anniehoogendoorn,項目名稱:UniversityRegistrar,代碼行數:10,代碼來源:StudentTest.php

示例3: Student

 function test_getName()
 {
     //Arrange
     $name = "Steve Beekman";
     $date = "2015-08-23";
     $test_student = new Student($name, $date);
     //Act
     $result = $test_student->getName();
     //Assert
     $this->assertEquals($name, $result);
 }
開發者ID:jlbethel,項目名稱:Registrar_test,代碼行數:11,代碼來源:StudentTest.php

示例4: Student

 function test_getName()
 {
     //Arrange
     $name = "Joleen";
     $enrollment = "8/25/2015";
     $test_student = new Student($name, $enrollment);
     //Act
     $result = $test_student->getName();
     //Assert
     $this->assertEquals($name, $result);
 }
開發者ID:kellimargaret,項目名稱:University_Registrar,代碼行數:11,代碼來源:StudentTest.php

示例5: Student

 function test_getName()
 {
     //Arrange
     $name = "Sandra Maley";
     $enrollment_date = "2015-06-21";
     $test_student = new Student($name, $enrollment_date);
     //Act
     $result = $test_student->getName();
     //Assert
     $this->assertEquals($name, $result);
 }
開發者ID:austinblanchard,項目名稱:university_registrar,代碼行數:11,代碼來源:StudentTest.php

示例6: update

 public function update(Student $object)
 {
     $q = "UPDATE " . self::TABLE . " SET `name`='" . Singleton::create("NullConverter")->fromDOMtoDB($object->getName()) . "' WHERE studentId='" . addslashes($object->getStudentId()) . "'";
     $pk = $object->getStudentId();
     if ($object->isNew()) {
         if (empty($pk)) {
             $q = "INSERT INTO " . self::TABLE . " (`name`) VALUES ('" . Singleton::create("NullConverter")->fromDOMtoDB($object->getName()) . "')";
         } else {
             $q = "INSERT INTO " . self::TABLE . " (`name`) VALUES ('" . Singleton::create("NullConverter")->fromDOMtoDB($object->getStudentId()) . "', '" . Singleton::create("NullConverter")->fromDOMtoDB($object->getName()) . "')";
         }
     }
     $this->db->updateQuery($q);
     if (empty($pk)) {
         $pk = $this->db->selectQuery("SELECT studentId from " . self::TABLE . " ORDER BY studentId DESC limit 1")->getSingleton();
     }
     $result = $this->findByPrimaryKey($pk);
     parent::$dbCache->resetEntity("Student");
     parent::$dbCache->setSingle("Student", $pk, $result);
     return $result;
 }
開發者ID:aeberh,項目名稱:php-movico,代碼行數:20,代碼來源:StudentPersistence.php

示例7: testUpdate

 function testUpdate()
 {
     //Arrange
     $name = "Ben";
     $enroll_date = "0000-00-00";
     $id = 1;
     $test_student = new Student($name, $enroll_date, $id);
     $test_student->save();
     $new_name = "Jen";
     //Act
     $test_student->update($new_name);
     //Assert
     $this->assertEquals($new_name, $test_student->getName());
 }
開發者ID:jtorrespdx,項目名稱:univ,代碼行數:14,代碼來源:StudentTest.php

示例8: employeemarkview

 protected function employeemarkview()
 {
     $date = $_GET['uid'];
     global $user;
     global $objPDO;
     $student = new Student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true) {
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/teacher_class.php';
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/employee_attendance_class.php';
         $emp = new Teacher($objPDO);
         $att = new EmployeeAttendence($objPDO);
         $employees = array();
         $employees = $emp->getTeacherArray(0);
         $marked = $att->getByDate($date);
         require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/employee_mark_att.php';
     } else {
         header('Location:http://localhost/cloud');
     }
 }
開發者ID:srinivasans,項目名稱:educloud,代碼行數:20,代碼來源:attendanceController.php

示例9: sendDamageNotification

 /**
  * Send notice to student about assessed damage amount.
  *
  * @param Student $student
  * @param string $term
  * @param integer $billedAmount
  */
 public static function sendDamageNotification(Student $student, $term, $billedAmount, $coordinatorName, $coordinatorEmail)
 {
     $subject = 'University Housing Room Damages Billed';
     $template = 'email/roomDamageNotice.tpl';
     $tags = array();
     $tags['NAME'] = $student->getName();
     $tags['AMOUNT'] = $billedAmount;
     $tags['TERM'] = $term;
     $tags['COORDINATOR_NAME'] = $coordinatorName;
     $tags['COORDINATOR_EMAIL'] = $coordinatorEmail;
     self::sendSwiftmailMessage(self::makeSwiftmailMessage($student, $subject, $tags, $template));
 }
開發者ID:jlbooker,項目名稱:homestead,代碼行數:19,代碼來源:HMS_Email.php

示例10: Department

			<table class="table table-bordered table-striped">
					<tbody>                                     
							<tr>
                                <th>Scholar Number</th>
                                <td><input type='hidden' name='scholar_no' value='<?php 
    echo Input::get('sid');
    ?>
'><?php 
    echo Input::get('sid');
    ?>
</td>
							</tr>
							<tr>
                                <th>Name</th>
                                <td><?php 
    echo $t->getName();
    ?>
</td>
                            </tr>
							<tr>
                                <th>Department</th>
						<td>
						<select name="department">
							<option value="" selected>Department</option>
							<?php 
    $dep = new Department();
    $departments = $dep->getAllDepartment();
    while ($department = $departments->fetch_object()) {
        ?>
							<option value="<?php 
        echo $department->dept_id;
開發者ID:mkrdip,項目名稱:Management-Information-System,代碼行數:31,代碼來源:edit_student.php

示例11: Department

                echo 'Invalid authentication. Please try again later or re-login.';
                echo '</div>';
                die;
            }
        }
    }
    $s->getInfo(Session::get('sn'));
    ?>
		<div class="col-md-2">
		</div>
		<div class="col-md-8">
			<div class="box box-primary">
				<div class="box-header">
					<div class="box-title pull-left">
						<h3><?php 
    echo $s->getName();
    ?>
</h3>
						<h4><?php 
    $d = new Department();
    $d->getInfo($s->getDep());
    echo $d->getDepName();
    unset($d);
    ?>
</h4>
						<h4><i><?php 
    echo $s->getEmail();
    ?>
</i></h4>
						<h4><i><?php 
    $username = explode('@', $s->getEmail())[0];
開發者ID:mkrdip,項目名稱:Management-Information-System,代碼行數:31,代碼來源:update_biography.php

示例12: testUpdate

 function testUpdate()
 {
     //Arrange
     $name = "Rick";
     $date = "2015-08-15";
     $id = 1;
     $test_student = new Student($name, $date, $id);
     $test_student->save();
     $new_name = "Obama";
     $new_date = "2015-10-10";
     //Act
     $test_student->update($new_name, $new_date);
     //Assert
     $this->assertEquals("Obama", $test_student->getName());
     $this->assertEquals("2015-10-10", $test_student->getDate());
 }
開發者ID:jlbethel,項目名稱:Registrar-switch,代碼行數:16,代碼來源:StudentTest.php

示例13: Student

 function test_update()
 {
     //Arrange
     $name = "Jeff Lebowski";
     $enrollment_date = "1973-12-12";
     $id = 1;
     $student = new Student($name, $enrollment_date, $id);
     $student->save();
     $new_name = "The Dude";
     //Act
     $student->update($new_name);
     //Assert
     $this->assertEquals("The Dude", $student->getName());
 }
開發者ID:kevintokheim,項目名稱:University_Registrar2,代碼行數:14,代碼來源:StudentTest.php

示例14: employeeview

 protected function employeeview()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if (($user->checkAdmin() == true || $student->checkTeacher()) && isset($_GET['uid'])) {
         $role = $student->getacctType();
         $type_img = array('1' => 'important.png', '2' => 'announcement.png', '3' => 'reminder.png', '4' => 'others.png');
         $id = $_GET['uid'];
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/employee_notice_class.php';
         include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_class.php';
         $notice = new EmployeeNotice($objPDO, $id);
         $elems = $notice->getAsArray();
         $stu = new Student($objPDO, $elems['user_id']);
         $elems['author_name'] = $stu->getName();
         $time = strtotime($elems['date']);
         $elems['day'] = date('d', $time);
         $elems['month'] = date('M', $time);
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/view_notice_employee.php';
     } else {
         header('Location:http://localhost/cloud');
     }
 }
開發者ID:srinivasans,項目名稱:educloud,代碼行數:24,代碼來源:noticeController.php

示例15: explode

<?php 
if (isset($_GET['input']) && isset($_GET['delimiter'])) {
    $lines = array_filter(array_map('trim', explode("\n", $_GET['input'])));
    $delimiter = $_GET['delimiter'];
    $students = [];
    foreach ($lines as $line) {
        $tokens = array_map('trim', explode($delimiter, $line));
        $name = $tokens[0];
        $age = $tokens[1];
        $grade = floatval($tokens[2]);
        $student = new Student($name, $age, $grade);
        $students[] = $student;
    }
    foreach ($students as $student) {
        echo "<ul>";
        echo "<li>" . "Name: " . $student->getName() . "</li>";
        echo "<li>" . "Age: " . $student->getAge() . "</li>";
        echo "<li>" . "Grade: " . $student->getGrade() . "</li>";
        echo "</ul>";
    }
}
class Student
{
    private $name;
    private $age;
    private $grade;
    function __construct($name, $age, $grade)
    {
        $this->name = $name;
        $this->age = $age;
        $this->grade = $grade;
開發者ID:evgeni-tsn,項目名稱:Fundamentals-SoftwareUniversity,代碼行數:31,代碼來源:08.storing-objects.php


注:本文中的Student::getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。