src/xPDO/Om/xPDOObject.php
public function toJSON($keyPrefix= '', $rawValues= false) {
        $json= '';
        $array= $this->toArray($keyPrefix, $rawValues);
        if ($array) {
            $json= $this->xpdo->toJSON($array);
        }
        return $json;
    }
public function toJSON($keyPrefix= '', $rawValues= false) {
        $json= '';
        $array= $this->toArray($keyPrefix, $rawValues);
        if ($array) {
            $json= $this->xpdo->toJSON($array);
        }
        return $json;
    }
public function toJSON ( $ keyPrefix = '' , $ rawValues = false ) { $ json = '' ; $ array = $ this -> toArray ( $ keyPrefix , $ rawValues ) ; if ( $ array ) { $ json = $ this -> xpdo -> toJSON ( $ array ) ; } return $ json ; }
Returns a JSON representation of the object.

@param string $keyPrefix An optional prefix to prepend to the field keys.
@param boolean $rawValues An optional flag indicating if the field values
should be returned raw or via {@link xPDOObject::get()}.
@return string A JSON string representing the object.
Returns a JSON representation of the object .