protected function switchContentType($data)
    {
        switch ($this->format) {
            case 'application/json':
                $data = json_encode(is_object($data) ? (array)$data : $data);
                break;

            case 'application/xml':
                $data = is_object($data) ? (string)$data : $data;
                break;

            default:
                $data = (string)$data;
        }

        return $data;
    }
protected function switchContentType($data)
    {
        switch ($this->format) {
            case 'application/json':
                $data = json_encode(is_object($data) ? (array)$data : $data);
                break;

            case 'application/xml':
                $data = is_object($data) ? (string)$data : $data;
                break;

            default:
                $data = (string)$data;
        }

        return $data;
    }
protected function switchContentType ( $ data ) { switch ( $ this -> format ) { case 'application/json' : $ data = json_encode ( is_object ( $ data ) ? ( array ) $ data : $ data ) ; break ; case 'application/xml' : $ data = is_object ( $ data ) ? ( string ) $ data : $ data ; break ; default : $ data = ( string ) $ data ; } return $ data ; }
Switch content type

@access protected

@param null|string $data Any content

@return string
Switch content type