src/xPDO/Om/xPDOObject.php
public function fromJSON($jsonSource, $keyPrefix= '', $setPrimaryKeys= false, $rawValues= false, $adhocValues= false) {
        $array= $this->xpdo->fromJSON($jsonSource, true);
        if ($array) {
            $this->fromArray($array, $keyPrefix, $setPrimaryKeys, $rawValues, $adhocValues);
        } else {
            $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, 'xPDOObject::fromJSON() -- Could not convert jsonSource to a PHP array.');
        }
    }
public function fromJSON($jsonSource, $keyPrefix= '', $setPrimaryKeys= false, $rawValues= false, $adhocValues= false) {
        $array= $this->xpdo->fromJSON($jsonSource, true);
        if ($array) {
            $this->fromArray($array, $keyPrefix, $setPrimaryKeys, $rawValues, $adhocValues);
        } else {
            $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, 'xPDOObject::fromJSON() -- Could not convert jsonSource to a PHP array.');
        }
    }
public function fromJSON ( $ jsonSource , $ keyPrefix = '' , $ setPrimaryKeys = false , $ rawValues = false , $ adhocValues = false ) { $ array = $ this -> xpdo -> fromJSON ( $ jsonSource , true ) ; if ( $ array ) { $ this -> fromArray ( $ array , $ keyPrefix , $ setPrimaryKeys , $ rawValues , $ adhocValues ) ; } else { $ this -> xpdo -> log ( xPDO :: LOG_LEVEL_ERROR , 'xPDOObject::fromJSON() -- Could not convert jsonSource to a PHP array.' ) ; } }
Sets the object fields from a JSON object string.

@param string $jsonSource A JSON object string.
@param string $keyPrefix An optional prefix to strip from the keys.
@param boolean $setPrimaryKeys Indicates if primary key fields should be set.
@param boolean $rawValues Indicates if values should be set raw or via
{@link xPDOObject::set()}.
@param boolean $adhocValues Indicates if ad hoc fields should be added to the
xPDOObject from the source object.
Sets the object fields from a JSON object string .