summaryrefslogtreecommitdiffstats
path: root/lib/public/appframework
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-08-03 21:03:11 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-08-03 21:03:11 +0200
commit649cc2fa898968b78e249d594e846c84c3695d8d (patch)
tree69d42f0eabaf11ce18ad14acd223553c424c93db /lib/public/appframework
parentcd1bfd7eb67e95d5fcd3336b8a4d4109459f27d4 (diff)
downloadnextcloud-server-649cc2fa898968b78e249d594e846c84c3695d8d.tar.gz
nextcloud-server-649cc2fa898968b78e249d594e846c84c3695d8d.zip
Remove duplicate and unused code
Diffstat (limited to 'lib/public/appframework')
-rw-r--r--lib/public/appframework/http/ocsresponse.php28
-rw-r--r--lib/public/appframework/ocscontroller.php8
2 files changed, 10 insertions, 26 deletions
diff --git a/lib/public/appframework/http/ocsresponse.php b/lib/public/appframework/http/ocsresponse.php
index 52d3c2fa665..2e788a52bb9 100644
--- a/lib/public/appframework/http/ocsresponse.php
+++ b/lib/public/appframework/http/ocsresponse.php
@@ -41,38 +41,26 @@ class OCSResponse extends Response {
private $format;
private $statuscode;
private $message;
- private $tag;
- private $tagattribute;
- private $dimension;
private $itemscount;
private $itemsperpage;
/**
* generates the xml or json response for the API call from an multidimenional data array.
* @param string $format
- * @param string $status
- * @param string $statuscode
+ * @param int $statuscode
* @param string $message
* @param array $data
- * @param string $tag
- * @param string $tagattribute
- * @param int $dimension
* @param int|string $itemscount
* @param int|string $itemsperpage
* @since 8.1.0
*/
- public function __construct($format, $status, $statuscode, $message,
- $data=[], $tag='', $tagattribute='',
- $dimension=-1, $itemscount='',
+ public function __construct($format, $statuscode, $message,
+ $data=[], $itemscount='',
$itemsperpage='') {
$this->format = $format;
- $this->setStatus($status);
$this->statuscode = $statuscode;
$this->message = $message;
$this->data = $data;
- $this->tag = $tag;
- $this->tagattribute = $tagattribute;
- $this->dimension = $dimension;
$this->itemscount = $itemscount;
$this->itemsperpage = $itemsperpage;
@@ -93,11 +81,11 @@ class OCSResponse extends Response {
* @since 8.1.0
*/
public function render() {
- return OC_OCS::generateXml(
- $this->format, $this->getStatus(), $this->statuscode, $this->message,
- $this->data, $this->tag, $this->tagattribute, $this->dimension,
- $this->itemscount, $this->itemsperpage
- );
+ $r = new \OC_OCS_Result($this->data, $this->statuscode, $this->message);
+ $r->setTotalItems($this->itemscount);
+ $r->setItemsPerPage($this->itemsperpage);
+
+ return \OC_API::renderResult($r, $this->format);
}
diff --git a/lib/public/appframework/ocscontroller.php b/lib/public/appframework/ocscontroller.php
index 602731fe761..aa71fd8f85f 100644
--- a/lib/public/appframework/ocscontroller.php
+++ b/lib/public/appframework/ocscontroller.php
@@ -42,7 +42,7 @@ abstract class OCSController extends ApiController {
* constructor of the controller
* @param string $appName the name of the app
* @param IRequest $request an instance of the request
- * @param string $corsMethods comma seperated string of HTTP verbs which
+ * @param string $corsMethods comma separated string of HTTP verbs which
* should be allowed for websites or webapps when calling your API, defaults to
* 'PUT, POST, GET, DELETE, PATCH'
* @param string $corsAllowedHeaders comma seperated string of HTTP headers
@@ -84,9 +84,6 @@ abstract class OCSController extends ApiController {
'statuscode' => 100,
'message' => 'OK',
'data' => [],
- 'tag' => '',
- 'tagattribute' => '',
- 'dimension' => 'dynamic',
'itemscount' => '',
'itemsperpage' => ''
];
@@ -97,8 +94,7 @@ abstract class OCSController extends ApiController {
return new OCSResponse(
$format, $params['status'], $params['statuscode'],
- $params['message'], $params['data'], $params['tag'],
- $params['tagattribute'], $params['dimension'],
+ $params['message'], $params['data'],
$params['itemscount'], $params['itemsperpage']
);
}