Метод | Описание | |
---|---|---|
__construct ( integer $options, integer $depth = 100 ) | Create the loader for a json string. | |
getSupported ( ) : string[] | ||
getTypeFromValue ( mixed $value ) : string | Get the type from a variable value. | |
getValueAsString ( string $type, mixed $value ) : null | string | ||
load ( mixed $source, string $contentType, array | Traversable | Options $options = [] ) : |
Load the json string into an DOMDocument | |
loadFragment ( string $source, string $contentType, array | Traversable | Options $options = [] ) : |
||
onMapKey ( null | FALSE | callable $callback = NULL ) : callable | null | Get/Set a mapping callback for the tag names. If it is a callable it will be set. FALSE removes the callback. |
Метод | Описание | |
---|---|---|
transferTo ( DOMNode $target, mixed $value, integer $recursions = 100 ) | Transfer a value into a target xml element node. This sets attributes on the target node and creates child elements for object and array values. |
Метод | Описание | |
---|---|---|
getQualifiedName ( string $key, string $default, boolean $isArrayElement = FALSE ) : string | Get a valid qualified name (tag name) using the property name/key. | |
transferArrayTo ( DOMNode $target, array $value, integer $recursions ) | Transfer an array value into a target element node. Sets the json:type attribute to 'array' and creates child element nodes for each array element using the default QName. | |
transferObjectTo ( DOMNode $target, object $value, integer $recursions ) | Transfer an object value into a target element node. If the object has no properties, the json:type attribute is always set to 'object'. If verbose is not set the json:type attribute will be omitted if the object value has properties. |
public __construct ( integer $options, integer $depth = 100 ) | ||
$options | integer | |
$depth | integer |
public getTypeFromValue ( mixed $value ) : string | ||
$value | mixed | |
Результат | string |
public loadFragment ( string $source, string $contentType, array | Traversable | Options $options = [] ) : |
||
$source | string | |
$contentType | string | |
$options | array | Traversable | Options | |
Результат |
protected transferTo ( DOMNode $target, mixed $value, integer $recursions = 100 ) | ||
$target | DOMNode | |
$value | mixed | |
$recursions | integer |