Changeset 158 for Dev/trunk/classes/RespondentConnector.php
- Timestamp:
- 11/18/11 11:07:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/RespondentConnector.php
r149 r158 12 12 class RespondentConnector implements IConnector{ 13 13 14 protected $model;15 14 protected $fileName = 'data/users/respondents.rdf'; 16 15 … … 20 19 public function __construct() 21 20 { 22 //Ensure the required folder for this connector exists23 21 if (!is_dir('data/users/')) 24 22 mkdir('data/users/'); … … 32 30 //Get the Memory Model from the ModelFactory 33 31 $this->model = ModelFactory::getDefaultModel(); 34 35 32 //Ensure the required file exists before loading 36 33 if(file_exists($this->fileName)) … … 47 44 48 45 /** 49 * function get( $arguments)46 * function get() 50 47 * Gets the array of Respondent objects belonging to arguments supplied. 51 48 * @param type $arguments : An array containing zero or more of the following keys: … … 57 54 $keys = array_keys($arguments); 58 55 //Set default values for arguments 59 $uid = " ?uid"; $name = "?name"; $password = "?password";56 $uid = ""; $name = ""; $password = ""; 60 57 //Set the arguments if they are supplied 61 58 if(in_array("uid", $keys)) 62 $uid = " \"".$arguments["uid"]."\"";59 $uid = "predicates:uid \"".$arguments["uid"]."\""; 63 60 if(in_array("name", $keys)) 64 $name = ' \''.$arguments["name"].'\'';61 $name = 'predicates:name \''.$arguments["name"].'\''; 65 62 if(in_array("password", $keys)) 66 $password = " \"".$arguments["password"]."\"";63 $password = "predicates:password \"".$arguments["password"]."\""; 67 64 68 65 //Create the querystring … … 77 74 predicates:name ?name ; 78 75 predicates:password ?password ; 79 predicates:uid ' . $uid . ' 80 predicates:name ' . $name . ' 81 predicates:password ' . $password . ' 76 ' . $uid . $name . $password . ' 82 77 }'; 83 78 //Query the model … … 96 91 97 92 /** 98 * Save the given User object in the file. 99 * @param type $rToolObject 93 * function set() 94 * @param type $rToolObject : The ResearchToolObject to be saved. 100 95 */ 101 96 public function set($rToolObject)
Note: See TracChangeset
for help on using the changeset viewer.