Inheritance: extends r\Datum\Datum
Exemple #1
0
 public static function decodedJSONToDatum($json)
 {
     if (is_null($json)) {
         return NullDatum::decodeServerResponse($json);
     }
     if (is_bool($json)) {
         return BoolDatum::decodeServerResponse($json);
     }
     if (is_int($json) || is_float($json)) {
         return NumberDatum::decodeServerResponse($json);
     }
     if (is_string($json)) {
         return StringDatum::decodeServerResponse($json);
     }
     if (is_array($json)) {
         return ArrayDatum::decodeServerResponse($json);
     }
     if (is_object($json)) {
         return ObjectDatum::decodeServerResponse($json);
     }
     throw new RqlDriverError("Unhandled type " . get_class($json));
 }
Exemple #2
0
 public static function decodeServerResponse($json)
 {
     $result = new StringDatum();
     $result->setValue((string) $json);
     return $result;
 }