Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
dc53c83e
Commit
dc53c83e
authored
11 years ago
by
Björn Schießle
Browse files
Options
Downloads
Patches
Plain Diff
getData() always needs to return an array
parent
75c8d74c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/private/ocs/result.php
+12
-6
12 additions, 6 deletions
lib/private/ocs/result.php
with
12 additions
and
6 deletions
lib/private/ocs/result.php
+
12
−
6
View file @
dc53c83e
...
...
@@ -29,7 +29,13 @@ class OC_OCS_Result{
* @param $data mixed the data to return
*/
public
function
__construct
(
$data
=
null
,
$code
=
100
,
$message
=
null
)
{
$this
->
data
=
$data
;
if
(
$data
===
null
)
{
$this
->
data
=
array
();
}
elseif
(
!
is_array
(
$data
))
{
$this
->
data
=
array
(
$this
->
data
);
}
else
{
$this
->
data
=
$data
;
}
$this
->
statusCode
=
$code
;
$this
->
message
=
$message
;
}
...
...
@@ -49,7 +55,7 @@ class OC_OCS_Result{
public
function
setItemsPerPage
(
int
$items
)
{
$this
->
perPage
=
$items
;
}
/**
* get the status code
* @return int
...
...
@@ -57,7 +63,7 @@ class OC_OCS_Result{
public
function
getStatusCode
()
{
return
$this
->
statusCode
;
}
/**
* get the meta data for the result
* @return array
...
...
@@ -76,15 +82,15 @@ class OC_OCS_Result{
return
$meta
;
}
/**
* get the result data
* @return array
|string|int
* @return array
*/
public
function
getData
()
{
return
$this
->
data
;
}
/**
* return bool if the method succedded
* @return bool
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment