Result¶
-
class
OC\OCS\
Result
¶ Source: lib/private/OCS/Result.php#34
Properties¶
-
protected static property
OC\OCS\Result::$
data
¶ Source: lib/private/OCS/Result.php#37 Type: array
-
protected static property
OC\OCS\Result::$
message
¶ Source: lib/private/OCS/Result.php#40 Type: null | string
-
protected static property
OC\OCS\Result::$
statusCode
¶ Source: lib/private/OCS/Result.php#43 Type: int
-
protected static property
OC\OCS\Result::$
items
¶ Source: lib/private/OCS/Result.php#46 Type: int
-
protected static property
OC\OCS\Result::$
perPage
¶ Source: lib/private/OCS/Result.php#49 Type: int
Methods¶
-
public
OC\OCS\Result::
__construct
($data=null, $code=100, $message=null, $headers=[])¶ - create the OCS_Result object
Source: Parameters: - $data (mixed) the data to return
- $code (int)
- $message (null | string)
- $headers (array)
-
public
OC\OCS\Result::
setTotalItems
($items)¶ - optionally set the total number of items available
Source: Parameters: - $items (int)
-
public
OC\OCS\Result::
setItemsPerPage
($items)¶ - optionally set the the number of items per page
Source: Parameters: - $items (int)
-
public
OC\OCS\Result::
getStatusCode
()¶ - get the status code
Source: lib/private/OCS/Result.php#94 Returns: int
-
public
OC\OCS\Result::
getMeta
()¶ - get the meta data for the result
Source: lib/private/OCS/Result.php#102 Returns: array
-
public
OC\OCS\Result::
getData
()¶ - get the result data
Source: lib/private/OCS/Result.php#120 Returns: array
-
public
OC\OCS\Result::
succeeded
()¶ - return bool Whether the method succeeded
Source: lib/private/OCS/Result.php#128 Returns: bool
-
public
OC\OCS\Result::
addHeader
($name, $value)¶ - Adds a new header to the response
Source: Parameters: - $name (string) The name of the HTTP header
- $value (string) The value, null will delete it
Returns: $this
-
public
OC\OCS\Result::
getHeaders
()¶ - Returns the set headers
Source: lib/private/OCS/Result.php#156 Returns: array the headers