Esempio n. 1
0
 /**
  * @param String $userName
  * @param String $password
  * @throws RDException if incorrect username/pw
  * @return Entity\StudentImpl the student obj
  */
 public function login($userName, $password)
 {
     $modelStudent = new Entity\StudentImpl();
     $modelStudent->setUserName($userName);
     $modelStudent->setPassword($password);
     $studentIter = $this->objectLayer->findStudent($modelStudent);
     if ($studentIter->size() <= 0) {
         throw new RDException($string = "Username or Password incorrect");
     } else {
         return $studentIter->current();
     }
 }
Esempio n. 2
0
 /**
  * Create a new Student object, given the set of initial attribute values.
  * @param firstName the first name
  * @param lastName the last name
  * @param userName the user (login) name
  * @param password the password
  * @param emailAddress the email address
  * @param studentId the student identifier
  * @param major the student's major
  * @param address the student's address
  * @return Entity\StudentImpl a new Student object instance with the given attribute values
  * @throws RDException in case either firstName, lastName, userName, or studentId is null
  */
 public function createStudent($firstName = null, $lastName = null, $userName = null, $password = null, $emailAddress = null, $studentId = null, $major = null, $address = null)
 {
     $aStudent = new Entity\StudentImpl();
     // if ($firstName != null && $lastName != null && $userName != null && $password != null &&
     //    $emailAddress != null && $studentId != null && $major != null && $address != null) {
     $aStudent->setFirstName($firstName);
     $aStudent->setLastName($lastName);
     $aStudent->setUserName($userName);
     $aStudent->setPassword($password);
     $aStudent->setEmailAddress($emailAddress);
     $aStudent->setStudentId($studentId);
     $aStudent->setMajor($major);
     $aStudent->setAddress($address);
     // }
     return $aStudent;
 }