Basho\Riak\Object::getContentEncoding PHP Method

getContentEncoding() public method

public getContentEncoding ( ) : string
return string
    public function getContentEncoding()
    {
        return $this->content_encoding;
    }

Usage Example

Beispiel #1
0
 public function getEncodedData()
 {
     $data = $this->getData();
     if (in_array($this->object->getContentType(), ['application/json', 'text/json'])) {
         return json_encode($data);
     } elseif (in_array($this->object->getContentEncoding(), ['base64'])) {
         return base64_encode($data);
     } elseif (in_array($this->object->getContentEncoding(), ['binary', 'none'])) {
         return $data;
     }
     return rawurlencode($data);
 }