|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Static Public Member Functions | |
| static | decode ($source=null, $objectDecodeType=Zend_Json::TYPE_ARRAY) |
| static | decodeUnicodeString ($chrs) |
Data Fields | |
| const | EOF = 0 |
| const | DATUM = 1 |
| const | LBRACE = 2 |
| const | LBRACKET = 3 |
| const | RBRACE = 4 |
| const | RBRACKET = 5 |
| const | COMMA = 6 |
| const | COLON = 7 |
Protected Member Functions | |
| __construct ($source, $decodeType) | |
| _decodeValue () | |
| _decodeObject () | |
| _decodeArray () | |
| _eatWhitespace () | |
| _getNextToken () | |
Static Protected Member Functions | |
| static | _utf162utf8 ($utf16) |
Protected Attributes | |
| $_source | |
| $_sourceLength | |
| $_offset | |
| $_token | |
| $_decodeType | |
Definition at line 35 of file Decoder.php.
|
protected |
Constructor
| string | $source | String source to decode |
| int | $decodeType | How objects should be decoded – see Zend_Json::TYPE_ARRAY and Zend_Json::TYPE_OBJECT for valid values |
Definition at line 97 of file Decoder.php.
|
protected |
Decodes a JSON array format: [element, element2,...,elementN]
Definition at line 261 of file Decoder.php.
|
protected |
Decodes an object of the form: { "attribute: value, "attribute2" : value,...}
If Zend_Json_Encoder was used to encode the original object then a special attribute called __className which specifies a class name that should wrap the data contained within the encoded source.
Decodes to either an array or StdClass object, based on the value of $_decodeType. If invalid $_decodeType present, returns as an array.
Definition at line 199 of file Decoder.php.
|
protected |
Recursive driving rountine for supported toplevel tops
Definition at line 165 of file Decoder.php.
|
protected |
Removes whitepsace characters from the source input
Definition at line 292 of file Decoder.php.
|
protected |
Retrieves the next token from the source stream
Definition at line 312 of file Decoder.php.
|
staticprotected |
Convert a string from one UTF-16 char to one UTF-8 char.
Normally should be handled by mb_convert_encoding, but provides a slower PHP-only method for installations that lack the multibye string extension.
This method is from the Solar Framework by Paul M. Jones
string $utf16 UTF-16 character string UTF-8 character
Definition at line 548 of file Decoder.php.
|
static |
Decode a JSON source string
Decodes a JSON encoded string. The value returned will be one of the following:
StdClass
By default, decoded objects will be returned as associative arrays; to return a StdClass object instead, pass Zend_Json::TYPE_OBJECT to the $objectDecodeType parameter.
Throws a Zend_Json_Exception if the source string is null.
@access public
| string | $source | String to be decoded |
| int | $objectDecodeType | How objects should be decoded; should be either or Zend_Json::TYPE_ARRAY or Zend_Json::TYPE_OBJECT; defaults to TYPE_ARRAY |
| Zend_Json_Exception |
Definition at line 144 of file Decoder.php.
|
static |
Decode Unicode Characters from \u0000 ASCII syntax.
This algorithm was originally developed for the Solar Framework by Paul M. Jones
http://svn.solarphp.com/core/trunk/Solar/Json.php string $value string
Definition at line 477 of file Decoder.php.
|
protected |
Definition at line 86 of file Decoder.php.
|
protected |
Definition at line 71 of file Decoder.php.
|
protected |
Definition at line 56 of file Decoder.php.
|
protected |
Definition at line 63 of file Decoder.php.
|
protected |
Definition at line 78 of file Decoder.php.
| const COLON = 7 |
Definition at line 49 of file Decoder.php.
| const COMMA = 6 |
Definition at line 48 of file Decoder.php.
| const DATUM = 1 |
Definition at line 43 of file Decoder.php.
| const EOF = 0 |
Parse tokens used to decode the JSON object. These are not for public consumption, they are just used internally to the class.
Definition at line 42 of file Decoder.php.
| const LBRACE = 2 |
Definition at line 44 of file Decoder.php.
| const LBRACKET = 3 |
Definition at line 45 of file Decoder.php.
| const RBRACE = 4 |
Definition at line 46 of file Decoder.php.
| const RBRACKET = 5 |
Definition at line 47 of file Decoder.php.