|  | 
|  | __construct ($empty_key='') | 
|  | Constructor.  More... 
 | 
|  | 
|  | getEmptyKey () | 
|  | Get the key that represents an empty string key in JSON.  More... 
 | 
|  | 
|  | decode ($json, $assoc=false, $depth=512, $options=0) | 
|  | Decode JSON while converting empty keys to a unique token.  More... 
 | 
|  | 
|  | encode ($value, $options=0, $depth=512) | 
|  | Encode JSON while converting unique token keys to empty strings.  More... 
 | 
|  | 
Definition at line 14 of file EmptyKeyEncoding.php.
 
◆ __construct()
      
        
          | Elgg\Json\EmptyKeyEncoding::__construct | ( |  | $empty_key = '' | ) |  | 
      
 
Constructor. 
- Parameters
- 
  
    | string | $empty_key | Optional key to replace "" keys with in JSON decode |  
 
Definition at line 26 of file EmptyKeyEncoding.php.
 
 
◆ decode()
      
        
          | Elgg\Json\EmptyKeyEncoding::decode | ( |  | $json, | 
        
          |  |  |  | $assoc = false, | 
        
          |  |  |  | $depth = 512, | 
        
          |  |  |  | $options = 0 | 
        
          |  | ) |  |  | 
      
 
Decode JSON while converting empty keys to a unique token. 
- Parameters
- 
  
    | string | $json | JSON string |  | bool | $assoc | Convert objects to assoc arrays? |  | int | $depth | Allowed recursion depth |  | int | $options | Bitmask json_decode options |  
 
- Returns
- mixed 
- See also
- json_decode 
Definition at line 53 of file EmptyKeyEncoding.php.
 
 
◆ encode()
      
        
          | Elgg\Json\EmptyKeyEncoding::encode | ( |  | $value, | 
        
          |  |  |  | $options = 0, | 
        
          |  |  |  | $depth = 512 | 
        
          |  | ) |  |  | 
      
 
Encode JSON while converting unique token keys to empty strings. 
- Parameters
- 
  
    | mixed | $value | Value to encode |  | int | $options | Encoding options |  | int | $depth | Allowed recursion depth. Do not set this before PHP 5.5 |  
 
- Returns
- string|false 
Definition at line 69 of file EmptyKeyEncoding.php.
 
 
◆ getEmptyKey()
      
        
          | Elgg\Json\EmptyKeyEncoding::getEmptyKey | ( |  | ) |  | 
      
 
Get the key that represents an empty string key in JSON. 
- Returns
- string 
Definition at line 38 of file EmptyKeyEncoding.php.
 
 
◆ $token
  
  | 
        
          | Elgg\Json\EmptyKeyEncoding::$token |  | protected | 
 
 
The documentation for this class was generated from the following file: