Changeset 186 for Dev/trunk/classes/SessionConnector.php
- Timestamp:
- 12/16/11 11:19:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/SessionConnector.php
r173 r186 59 59 $pipeline = $this->getPipeline($result['?uid']->label); 60 60 $answersets = $this->getAnswerSets($result['?uid']->label); 61 $creator = $ this->db->get("User", array("uid" => $result['?creator']->label));61 $creator = $result['?creator']->label; 62 62 $datetime = new DateTime(); 63 63 $datetime->setTimestamp(intval($result['?datetime']->label)); 64 $sessions[] = new Session($result['?uid']->label, $result['?title']->label, $creator [0], $datetime, $pipeline, $answersets);64 $sessions[] = new Session($result['?uid']->label, $result['?title']->label, $creator, $datetime, $pipeline, $answersets); 65 65 } 66 66 } … … 79 79 { 80 80 $element = $iterator->next(); 81 if(strpos($element->getLabelPredicate(), "has_application") != false) 82 { 83 $applications = $this->db->get("application", array("uid" => $element->getLabelObject())); 84 $pipeline[] = $applications[0]; 85 } 86 else 87 { 88 $surveys = $this->db->get("survey", array("uid" => $element->getLabelObject())); 89 $pipeline[] = $surveys[0]; 90 } 81 $pipeline[] = $element->getLabelObject(); 91 82 } 92 83 return $pipeline; … … 105 96 { 106 97 $element = $iterator->next(); 107 $resultsets = $this->db->get("answerset", array("uid" => $element->getLabelObject())); 108 $answersets[] = $resultsets[0]; 98 $answersets[] = $element->getLabelObject(); 109 99 } 110 100 return $answersets; … … 118 108 { 119 109 $this->load(); 110 //If evaluation fails, some references are incorrect. 111 //We shouldn't save in this case. Instead - let the user know. This function returns false if the evaluation has failed. 112 //TODO: Decide how to fix invalid references graciously. 113 if(!$rToolObject->evaluate()) 114 return false; 115 120 116 $resourceSession = new Resource(SESSION . '/' . $rToolObject->uid); 121 117 //Remove the old value stored with the given id … … 171 167 172 168 $this->save(); 169 return true; 173 170 } 174 171 }
Note: See TracChangeset
for help on using the changeset viewer.