Changeset 252 for Dev/branches/jQueryUI/server/classes/models/User.php
- Timestamp:
- 02/10/12 15:25:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/jQueryUI/server/classes/models/User.php
r249 r252 16 16 private static $filename = 'data/users/users.rdf'; 17 17 18 public $ name;18 public $email; 19 19 public $password; 20 20 … … 23 23 * If the user does not yet exist in the database, call with null as first parameter 24 24 */ 25 public function __construct($uid = null, $ name= null, $password = null) {25 public function __construct($uid = null, $email = null, $password = null) { 26 26 if(!isset($uid)) 27 27 { … … 29 29 } 30 30 $this->uid = $uid; 31 $this->name = $name;31 $this->email = $email; 32 32 $this->password = $password; 33 33 } … … 56 56 $model->add(new Statement($resourceUser,$predicateUniqueID,$literalUserID)); 57 57 58 $literalUserName = new Literal($this-> name);59 $predicateName = new Resource( NAME);58 $literalUserName = new Literal($this->email); 59 $predicateName = new Resource(EMAIL); 60 60 $model->add(new Statement($resourceUser,$predicateName,$literalUserName)); 61 61 … … 73 73 * Gets the array of User objects belonging to arguments supplied. 74 74 * @param type $arguments : An array containing zero or more of the following keys: 75 * 'uid', ' name', 'password'75 * 'uid', 'email', 'password' 76 76 */ 77 77 public static function get($arguments) … … 82 82 PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '> 83 83 PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '> 84 SELECT ?uid, ? name, ?password84 SELECT ?uid, ?email, ?password 85 85 WHERE 86 86 { 87 87 _user predicates:resource_type resources:user ; 88 88 predicates:uid ?uid ; 89 predicates: name ?name;89 predicates:email ?email ; 90 90 predicates:password ?password ; 91 91 ' . ResearchToolObject::createArguments($arguments) . ' … … 99 99 foreach($results as $result) 100 100 { 101 $users[] = new User($result['?uid']->label, $result['?name']->label, $result['?password']->label);101 $users[] = new User($result['?uid']->label, $result['?email']->label, $result['?password']->label); 102 102 } 103 103 } 104 104 return $users; 105 105 } 106 107 108 106 } 109 107
Note: See TracChangeset
for help on using the changeset viewer.