src/DynamoDb/Marshaler.php
public function marshalJson($json)
    {
        $data = json_decode($json);
        if (!($data instanceof \stdClass)) {
            throw new \InvalidArgumentException(
                'The JSON document must be valid and be an object at its root.'
            );
        }

        return current($this->marshalValue($data));
    }
public function marshalJson($json)
    {
        $data = json_decode($json);
        if (!($data instanceof \stdClass)) {
            throw new \InvalidArgumentException(
                'The JSON document must be valid and be an object at its root.'
            );
        }

        return current($this->marshalValue($data));
    }
public function marshalJson ( $ json ) { $ data = json_decode ( $ json ) ; if ( ! ( $ data instanceof \ stdClass ) ) { throw new \ InvalidArgumentException ( 'The JSON document must be valid and be an object at its root.' ) ; } return current ( $ this -> marshalValue ( $ data ) ) ; }
Marshal a JSON document from a string to a DynamoDB item.

The result is an array formatted in the proper parameter structure
required by the DynamoDB API for items.

@param string $json A valid JSON document.

@return array Item formatted for DynamoDB.
@throws \InvalidArgumentException if the JSON is invalid.
Marshal a JSON document from a string to a DynamoDB item .