protected function formatJSON()
    {
        $result = new \stdClass();

        if ($this->outputMode == self::MODE_ERROR) {
            $this->formatFailure($result);
        } else {
            $this->formatSuccess($result);
        }

        // include valid, plain non-namespace data
        foreach ($this->plain as $key => $value) {
            $result->$key = $value;
        }
        //TODO: better handling of links (self, related, pagination) http://jsonapi.org/format/#document-links

        if ($this->meta) {
            $result->meta = $this->meta;
        }

        return $result;
    }
protected function formatJSON()
    {
        $result = new \stdClass();

        if ($this->outputMode == self::MODE_ERROR) {
            $this->formatFailure($result);
        } else {
            $this->formatSuccess($result);
        }

        // include valid, plain non-namespace data
        foreach ($this->plain as $key => $value) {
            $result->$key = $value;
        }
        //TODO: better handling of links (self, related, pagination) http://jsonapi.org/format/#document-links

        if ($this->meta) {
            $result->meta = $this->meta;
        }

        return $result;
    }
protected function formatJSON ( ) { $ result = new \ stdClass ( ) ; if ( $ this -> outputMode == self :: MODE_ERROR ) { $ this -> formatFailure ( $ result ) ; } else { $ this -> formatSuccess ( $ result ) ; } // include valid, plain non-namespace data foreach ( $ this -> plain as $ key => $ value ) { $ result -> $ key = $ value ; } //TODO: better handling of links (self, related, pagination) http://jsonapi.org/format/#document-links if ( $ this -> meta ) { $ result -> meta = $ this -> meta ; } return $ result ; }
adapters function to spit output into a generic class, which will be converted to json before too long

@return \stdClass
adapters function to spit output into a generic class which will be converted to json before too long