/** * Mint a new Object instance with a json encoded string * * @param mixed $data * * @return $this */ public function buildJsonObject($data) { $this->object = new RObject(); $this->object->setData($data); $this->object->setContentType(Http::CONTENT_TYPE_JSON); return $this; }
/** * Create a new Riak object that will be stored as plain text/binary. * * @param string $key - Name of the key. * @param object $data - The data to store. * @param string $content_type - The content type of the object. (default 'application/json') * @return Object */ public function newBinary($key, $data, $content_type = 'application/json') { $obj = new Object($this->client, $this, $key); $obj->setData($data); $obj->setContentType($content_type); $obj->jsonize = false; return $obj; }