-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathResult.php
More file actions
executable file
·70 lines (61 loc) · 1.6 KB
/
Result.php
File metadata and controls
executable file
·70 lines (61 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* Result
*
* PHP version 5
*
* @category PHP
* @package Contentstack
* @author Uttam K Ukkoji <uttamukkoji@gmail.com>
* @author Rohit Mishra <rhtmishra4545@gmail.com>
* @copyright 2012-2021 Contentstack. All Rights Reserved
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
* @link https://pear.php.net/package/contentstack
* */
namespace Contentstack\Stack;
/**
* Class Result
*
* @category PHP
* @package Contentstack
* @author Uttam K Ukkoji <uttamukkoji@gmail.com>
* @author Rohit Mishra <rhtmishra4545@gmail.com>
* @copyright 2012-2021 Contentstack. All Rights Reserved
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
* @link https://pear.php.net/package/contentstack
* */
#[\AllowDynamicProperties]
class Result
{
private $_object;
/**
* Result constructor
* Result wrapper over the plain result for the future
*
* @param object $result - Response object
* */
public function __construct($result = '')
{
$this->_object = $result;
}
/**
* To convert result object to json
*
* @return json format of the result
* */
public function toJSON()
{
return $this->_object;
}
/**
* Get the keys from the object
*
* @param string $key - key whose corresponding value to be retrieved
*
* @return Value
* */
public function get($key)
{
return ($key && is_string($key)) ? $this->_object[$key] : null;
}
}