Changeset 130 for Dev/branches/jos-branch/classes/ApplicationConnector.php
- Timestamp:
- 10/24/11 13:47:23 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/jos-branch/classes/ApplicationConnector.php
r128 r130 61 61 //Set the arguments if they are supplied 62 62 if(in_array("uid", $keys)) 63 $uid = "\"".$arguments[" id"]."\"";63 $uid = "\"".$arguments["uid"]."\""; 64 64 if(in_array("title", $keys)) 65 65 $title = '\''.$arguments["title"].'\''; … … 81 81 predicates:description ?description ; 82 82 predicates:style ?style ; 83 83 predicates:uid ' . $uid . ' 84 84 predicates:title ' . $title . ' 85 85 predicates:description ' . $description . ' 86 predicates:style ' . $style . ' 86 predicates:style ' . $style . ' 87 87 }'; 88 88 89 89 //Query the model 90 90 $results = $this->model->sparqlQuery($querystring); 91 if(!empty($results)) 92 { 93 $applications = array(); 94 //Run over all results and create appropriate Application objets 95 foreach($results as $result) 96 { 97 $applications[] = new Application($result['?uid']->label, $result['?title']->label, $result['?description']->label, $result['?style']->label); 98 } 99 //Return the list of application objects 100 return $applications; 101 } 102 else 103 { 104 return array(); 105 } 91 $applications = array(); 92 if(!empty($results)) 93 { 94 //Run over all results and create appropriate Application objets 95 foreach($results as $result) 96 { 97 $applications[] = new Application($result['?uid']->label, $result['?title']->label, $result['?description']->label, $result['?style']->label); 98 } 99 } 100 return $applications; 106 101 } 107 102 … … 114 109 public function set($rToolObject) 115 110 { 111 $this->load(); 116 112 $resourceApplication = new Resource(APPLICATION.'/'.$rToolObject->uid); 117 118 119 120 113 //Remove the old value stored with the given id 114 $this->model->subtract($this->model->find($resourceApplication, null, null)); 115 116 //Add the new statements to the model 121 117 $resourceApplicationType = new Resource(APPLICATION); 122 118 $predicateRType = new Resource(RTYPE); … … 139 135 $this->model->add(new Statement($resourceApplication,$predicateStyle,$applicationStyle)); 140 136 141 137 $this->save(); 142 138 } 143 139 }
Note: See TracChangeset
for help on using the changeset viewer.