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:
<?php
namespace Contentstack\Result;
class Result {
private $object;
/*
* Result constructor
* Result wrapper over the plain result for the future
* */
public function __construct($result = '') {
$this->object = $result;
}
/*
* toJSON
* To convert result object to json
* @param
* @return json format of the result
* */
public function toJSON() {
return $this->object;
}
/*
* get
* 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;
}
}