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


PHP Student::setName方法代码示例

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


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

示例1: getAsObject

 protected function getAsObject($row)
 {
     $result = new Student();
     $result->setNew(false);
     $result->setStudentId(Singleton::create("NullConverter")->fromDBtoDOM($row["studentId"]));
     $result->setName(Singleton::create("NullConverter")->fromDBtoDOM($row["name"]));
     return $result;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:8,代码来源:StudentPersistence.php

示例2: 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');
         }
     }
 }
开发者ID:eyumay,项目名称:srms.psco,代码行数:55,代码来源:actions.class.php

示例3: testSetName

 function testSetName()
 {
     //Arrange
     $name = "Student1";
     $test_student = new Student($name);
     //Act
     $test_student->setName("Student1");
     $result = $test_student->getName();
     //Assert
     $this->assertEquals("Student1", $result);
 }
开发者ID:anniehoogendoorn,项目名称:UniversityRegistrar,代码行数:11,代码来源:StudentTest.php

示例4: validate

 protected function validate()
 {
     $required = array("teacher_id" => "Teacher Id", "admission_date" => "Admission Date", "name" => "Name", "subject_id" => "Subject", "date_of_birth" => "Date of Birth", "gender" => "Gender", "mobile" => "Mobile");
     global $user;
     if ($user->checkAdmin() == true) {
         if (isset($_POST)) {
             foreach ($required as $key => $value) {
                 if (!isset($_POST[$key]) || $_POST[$key] == '' || $_POST[$key] == 'select') {
                     echo $value . ' is Required<br/>';
                     return;
                 }
             }
             if (!is_numeric($_POST['mobile'])) {
                 echo "Mobile number must be Numeric";
             } else {
                 if (isset($_POST['permanent_pincode']) && $_POST['permanent_pincode'] != '' && !is_numeric($_POST['permanent_pincode']) || isset($_POST['correspondence_pincode']) && $_POST['correspondence_pincode'] != '' && !is_numeric($_POST['correspondence_pincode'])) {
                     echo "Pincode must be Numeric";
                 } else {
                     echo 'Saving...';
                     global $objPDO;
                     require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_class.php';
                     require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
                     $teacher = new Student($objPDO);
                     $teacherProfile = new Teacher($objPDO);
                     $temp_pass = substr(md5(microtime()), 5, 10);
                     $pass = md5($temp_pass);
                     $teacher_id = $_POST['teacher_id'];
                     if ($_POST['blood_group'] == 'select') {
                         unset($_POST['blood_group']);
                     }
                     $acct_type = 'teacher';
                     $teacher->setacctType($acct_type);
                     $teacher->loadByRoll($teacher_id);
                     $teacher->setRollNo($teacher_id);
                     $teacher->setPhone($_POST['phone']);
                     $teacher->setName($_POST['name']);
                     $teacher->setEmail($_POST['email']);
                     if ($teacher->getPassword() == '' || $teacher->getPassword() == NULL) {
                         $teacher->setPassword($pass);
                     }
                     $teacher->save();
                     $id = $teacher->getID();
                     $teacherProfile->setByArray($_POST);
                     $teacherProfile->setTempPass($temp_pass);
                     $teacherProfile->setUserId($id);
                     $teacherProfile->save();
                     echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/teacher/confirm/' . $teacherProfile->getUserId() . '"/>';
                 }
             }
         }
     } else {
         header('Location:http://localhost/cloud');
     }
 }
开发者ID:srinivasans,项目名称:educloud,代码行数:54,代码来源:teacherController.php

示例5: testSetName

 function testSetName()
 {
     //Arrange
     $name = "Elliot Michaels";
     $date = "2015-08-03";
     $test_student = new Student($name, $date);
     //Act
     $test_student->setName("Elliot Michaels");
     $result = $test_student->getName();
     //Assert
     $this->assertEquals("Elliot Michaels", $result);
 }
开发者ID:Camolot,项目名称:student,代码行数:12,代码来源:StudentTest.php

示例6: testSetName

 function testSetName()
 {
     //Arrange
     $name = "Bob";
     $date_of_enrollment = "2015-08-15";
     $test_student = new Student($name, $date_of_enrollment);
     //Act
     $test_student->setName('jack');
     $result = $test_student->getName();
     //Assert
     $this->assertEquals('jack', $result);
 }
开发者ID:jeffaustin81,项目名称:University_Registrar_Continued,代码行数:12,代码来源:StudentTest.php

示例7: Student

 function test_setName()
 {
     //Arrange
     $name = "Tom Jackson";
     $enrollment_date = "2016-08-18";
     $test_student = new Student($name, $enrollment_date);
     //Act
     $test_student->setName("Jim Jackson");
     $result = $test_student->getName();
     //Assert
     $this->assertEquals("Jim Jackson", $result);
 }
开发者ID:kevintokheim,项目名称:University_Registrar2,代码行数:12,代码来源:StudentTest.php

示例8: Student

 function test_setName()
 {
     //Arrange
     $name = "Ben";
     $id = null;
     $enrollment_date = "2015-12-12";
     $test_student = new Student($name, $enrollment_date, $id);
     //Act
     $test_student->setName("Jeremy");
     $result = $test_student->getName();
     //Assert
     $this->assertEquals("Jeremy", $result);
 }
开发者ID:jeffaustin81,项目名称:University_Registrar,代码行数:13,代码来源:StudentTest.php

示例9: testSetName

 function testSetName()
 {
     //Arrange
     $name = "Rick";
     $date = "2015-08-15";
     $id = 1;
     $test_student = new Student($name, $date, $id);
     //Act
     $test_student->setName("Judy");
     $result = $test_student->getName();
     //Asset
     $this->assertEquals("Judy", $result);
 }
开发者ID:jlbethel,项目名称:Registrar-switch,代码行数:13,代码来源:StudentTest.php

示例10: Student

 function test_setName()
 {
     //Arrange
     $name = "Joleen";
     $enrollment = "8/25/2015";
     $test_student = new Student($name, $enrollment);
     $new_name = "Babs";
     //Act
     $test_student->setName($new_name);
     $result = $test_student->getName();
     //Assert
     $this->assertEquals($new_name, $result);
 }
开发者ID:kellimargaret,项目名称:University_Registrar,代码行数:13,代码来源:StudentTest.php

示例11: testSetName

 function testSetName()
 {
     //Arrange
     $name = "Ben";
     $enroll_date = "0000-00-00";
     $id = 1;
     $test_student = new Student($name, $enroll_date, $id);
     //Act
     $test_student->setName("Jen");
     $result = $test_student->getName();
     //Assert
     $this->assertEquals("Jen", $result);
 }
开发者ID:jtorrespdx,项目名称:univ,代码行数:13,代码来源:StudentTest.php

示例12: testSetName

 function testSetName()
 {
     //Arrange
     $id = null;
     $name = "Micah";
     $enrollment_date = "2015-08-28";
     $test_student = new Student($id, $name, $enrollment_date);
     //Act
     $test_student->setName("Phil");
     $result = $test_student->getName();
     //Assert
     $this->assertEquals("Phil", $result);
 }
开发者ID:kellimargaret,项目名称:University_Registrar_Part2,代码行数:13,代码来源:StudentTest.php

示例13: array

<?php

require_once 'student_class.php';
require_once 'pdofactory_class.php';
$strDSN = 'mysql:dbname=cloud;host=localhost';
$objPDO = PDOfactory::GetPDO($strDSN, "root", "", array());
$objPDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$objUser = new Student($objPDO);
$objUser->setRollNo("admin");
$objUser->setName("admin");
$objUser->setEmail("srini2351994@yahoo.com");
$objUser->setPassword("827ccb0eea8a706c4c34a16891f84e7b");
$objUser->setPhone("2346");
$objUser->setacctType("admin");
$objUser->save();
echo $objUser->getName();
echo $objUser->getEmail();
echo $objUser->getPassword();
echo $objUser->getPhone();
//$objUser->markForDeletion();
开发者ID:srinivasans,项目名称:educloud,代码行数:20,代码来源:test.php

示例14: Student

$newStd3->setCourse('3rd');
$newStd3->store();
$newStd3->setSpecialty('Finance');
$newStd3->store();
$newStd3->displayInfo();
$newStd4 = new Student();
$newStd4->setName('Todor');
$newStd4->setSurname('Todorov');
$newStd4->setFamilyName('Todorov');
$newStd4->setPersonalId(345678904);
$newStd4->setSpecialty('Tourism');
$newStd4->setCourse('3rd');
$newStd4->store();
$newStd4->displayInfo();
$newStd5 = new Student();
$newStd5->setName('Kiril');
$newStd5->setSurname('Kirilov');
$newStd5->setFamilyName('Kirilov');
$newStd5->setPersonalId(456789011);
$newStd5->setSpecialty('Economics');
$newStd5->setCourse('4th');
$newStd5->store();
$newStd5->displayInfo();
$newTchr1 = new Teacher();
$newTchr1->setName('Todor');
$newTchr1->setSurname('Ivanov');
$newTchr1->setFamilyName('Todorov');
$newTchr1->setPersonalId(901234561);
$newTchr1->setItem('Sport');
$newTchr1->store();
$newTchr1->setItem('Biology');
开发者ID:nadiaborisova,项目名称:php-mysql-course-softacad,代码行数:31,代码来源:index.php

示例15: School

    */
}
$school=new School();
$school->setName('fooschool');

$school->createStudent()->setName("foostu1")->save();
$school->createStudent()->setName("foostu2")->save();
$school->save();

$students=$school->getStudents();//=>MongoRecordIterator
var_dump($students->count());//=>2
foreach($students as $student)
  {
    var_dump($student);
  }

$student=new Student();
$student->setName('foostu3')->save();
$school->addStudent($student);
$students=$school->getStudents();//=>MongoRecordIterator
var_dump($students->count());//=>3
foreach($students as $stu)
  {
    var_dump($stu);
  }

$student->setSchool($school)->save();

var_dump($student->getSchool()->getName());//=>'fooschool'

?>
开发者ID:poovarasanvasudevan,项目名称:MongoRecord,代码行数:31,代码来源:easysample.php


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