1: <?php
2: namespace Contentstack\Result;
3:
4: class Result {
5: private $object;
6:
7: /*
8: * Result constructor
9: * Result wrapper over the plain result for the future
10: * */
11: public function __construct($result = '') {
12: $this->object = $result;
13: }
14:
15: /*
16: * toJSON
17: * To convert result object to json
18: * @param
19: * @return json format of the result
20: * */
21: public function toJSON() {
22: return $this->object;
23: }
24:
25: /*
26: * get
27: * Get the keys from the object
28: * @param
29: * string|key - key whose corresponding value to be retrieved
30: * @return Value
31: * */
32: public function get($key) {
33: return ($key && is_string($key)) ? $this->object[$key] : NULL;
34: }
35: }