Changeset 149 for Dev/trunk/classes/SurveyConnector.php
- Timestamp:
- 11/07/11 16:55:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/SurveyConnector.php
r139 r149 55 55 $keys = array_keys($arguments); 56 56 //Set default values for arguments 57 $uid = "?uid"; $title = "?title"; $description = "?description"; $ questions = "";57 $uid = "?uid"; $title = "?title"; $description = "?description"; $creator = "?creator"; $questions = ""; 58 58 if(in_array("uid", $keys)) 59 59 $uid = '\''.$arguments["uid"].'\''; … … 61 61 $title = '\''.$arguments["title"].'\''; 62 62 if(in_array("description", $keys)) 63 $description = "\"".$arguments["description"]."\""; 63 $description = "\"".$arguments["description"]."\""; 64 if(in_array("creator", $keys)) 65 $creator = "\"".$arguments["creator"]."\""; 64 66 if(in_array("questions", $keys)) 65 67 { … … 75 77 PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '> 76 78 PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '> 77 SELECT DISTINCT ?uid, ?title, ?description 79 SELECT DISTINCT ?uid, ?title, ?description, ?creator 78 80 WHERE 79 81 { … … 84 86 predicates:uid ' . $uid . ' 85 87 predicates:title ' . $title . ' 86 predicates:description ' . $description . ' 88 predicates:description ' . $description . ' 89 predicates:creator ' . $creator . ' 87 90 ' . $questions . ' 88 91 }'; … … 98 101 foreach($results as $result) 99 102 { 100 $questions = $this->getQuestions($result['?uid']->label); 101 $surveys[] = new Survey($result['?uid']->label, $result['?title']->label, $result['?description']->label, $questions); 103 $questions = $this->getQuestions($result['?uid']->label); 104 $creator = $this->db->get("user", array("uid" => $result['?creator']->label)); 105 $surveys[] = new Survey($result['?uid']->label, $result['?title']->label, $result['?description']->label, $creator[0], $questions); 102 106 } 103 107 } … … 165 169 $this->model->add(new Statement($resourceSurvey,$predicateDescription,$surveyDescription)); 166 170 171 $predicateCreator = new Resource(CREATOR); 172 $surveyCreator = new Literal($rToolObject->creator->uid); 173 $this->model->add(new Statement($resourceSurvey, $predicateCreator, $surveyCreator)); 174 167 175 if(isset($rToolObject->questions)) 168 176 {
Note: See TracChangeset
for help on using the changeset viewer.