public function fromJson($json) {
    Helpers::checkType('json', 'string', $json);
    $decoded_value = json_decode($json);
    if ($decoded_value === null && ($json !== 'null' || $json !== '')) {
      throw new \Exception('Invalid JSON.');
    }
    return $this->setValue($decoded_value);
  }
public function fromJson($json) {
    Helpers::checkType('json', 'string', $json);
    $decoded_value = json_decode($json);
    if ($decoded_value === null && ($json !== 'null' || $json !== '')) {
      throw new \Exception('Invalid JSON.');
    }
    return $this->setValue($decoded_value);
  }
public function fromJson ( $ json ) { Helpers :: checkType ( 'json' , 'string' , $ json ) ; $ decoded_value = json_decode ( $ json ) ; if ( $ decoded_value === null && ( $ json !== 'null' || $ json !== '' ) ) { throw new \ Exception ( 'Invalid JSON.' ) ; } return $ this -> setValue ( $ decoded_value ) ; }
Adds properties from JSON.
@param string $json
@return Atom $this
Adds properties from JSON .