r\Datum\ObjectDatum::setValue PHP Method

setValue() public method

public setValue ( $val )
    public function setValue($val)
    {
        if (!is_array($val)) {
            throw new RqlDriverError("Not an array: " . $val);
        }
        foreach ($val as $k => $v) {
            if (!is_string($k) && !is_numeric($k)) {
                throw new RqlDriverError("Not a string or number: " . $k);
            }
            if (!(is_object($v) && is_subclass_of($v, "\\r\\Query"))) {
                throw new RqlDriverError("Not a Query: " . $v);
            }
        }
        parent::setValue($val);
    }

Usage Example

Ejemplo n.º 1
0
 public static function decodeServerResponse($json)
 {
     $jsonObject = (array) $json;
     foreach ($jsonObject as $key => &$val) {
         $val = DatumConverter::decodedJSONToDatum($val);
         unset($val);
     }
     $result = new ObjectDatum();
     $result->setValue($jsonObject);
     return $result;
 }