protected function encode($data)
    {
        switch ($this->responseEncoding){
            case "application/rdf+xml":
                throw new common_exception_NotImplemented();
                break;
            case "text/xml":
            case "application/xml":
                return tao_helpers_Xml::from_array($data);
            case "application/json":
            default:
                return json_encode($data);
        }
    }
protected function encode($data)
    {
        switch ($this->responseEncoding){
            case "application/rdf+xml":
                throw new common_exception_NotImplemented();
                break;
            case "text/xml":
            case "application/xml":
                return tao_helpers_Xml::from_array($data);
            case "application/json":
            default:
                return json_encode($data);
        }
    }
protected function encode ( $ data ) { switch ( $ this -> responseEncoding ) { case "application/rdf+xml" : throw new common_exception_NotImplemented ( ) ; break ; case "text/xml" : case "application/xml" : return tao_helpers_Xml :: from_array ( $ data ) ; case "application/json" : default : return json_encode ( $ data ) ; } }
Encode data regarding responseEncoding

@param $data
@return string
@throws common_exception_NotImplemented
Encode data regarding responseEncoding