Open Semantic Framework PHP API  3.0
 All Data Structures Namespaces Files Functions Variables Pages
DatasetUpdateQuery.php
Go to the documentation of this file.
1 <?php
2 
5 
11 
139  class DatasetUpdateQuery extends \StructuredDynamics\osf\php\api\framework\WebServiceQuery
140  {
149  function __construct($network, $appID, $apiKey, $userID)
150  {
151  // Set the OSF network & credentials to use for this query.
152  $this->setNetwork($network);
153  $this->appID = $appID;
154  $this->apiKey = $apiKey;
155  $this->userID = $userID;
156 
157  // Set default configarations for this web service query
158  $this->setSupportedMimes(array("text/xml",
159  "application/json",
160  "application/rdf+xml",
161  "application/rdf+n3",
162  "application/iron+json",
163  "application/iron+csv"));
164 
165  $this->setMethodPost();
166 
167  $this->mime("resultset");
168 
169  $this->setEndpoint("dataset/update/");
170 
171  // Set default parameters for this query
172  $this->sourceInterface("default");
173  }
174 
186  public function uri($uri)
187  {
188  $this->params["uri"] = urlencode($uri);
189 
190  return($this);
191  }
192 
204  public function title($title)
205  {
206  $this->params["title"] = urlencode($title);
207 
208  return($this);
209  }
210 
222  public function description($description)
223  {
224  $this->params["description"] = urlencode($description);
225 
226  return($this);
227  }
228 
241  public function contributors($contributorsUris)
242  {
243  // Encode potential ";" characters
244  foreach($contributorsUris as $key => $curi)
245  {
246  $contributorsUris[$key] = str_replace(";", "%3B", $curi);
247  }
248 
249  $this->params["contributors"] = urlencode(implode(";", $contributorsUris));
250 
251  return($this);
252  }
253 
263  public function modified($date)
264  {
265  $this->params["modified"] = urlencode($date);
266 
267  return($this);
268  }
269  }
270 
272 ?>
Dataset Update Query to a OSF Dataset Update web service endpoint.
modified($date)
Specifies the date of the modification of the dataset.
uri($uri)
Set the URI of the dataset to update its description.
__construct($network, $appID, $apiKey, $userID)
Constructor.
description($description)
Set the description of the dataset to update.
contributors($contributorsUris)
Redefine the contributors to this dataset.