상속: extends r\Datum\Datum
예제 #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));
 }
예제 #2
0
 public static function decodeServerResponse($json)
 {
     $result = new StringDatum();
     $result->setValue((string) $json);
     return $result;
 }