Example #1
0
 public function __construct($args, Query $top)
 {
     if (!is_array($args)) {
         throw new RqlDriverError("Arguments must be an array.");
     }
     foreach ($args as &$arg) {
         if (!is_a($arg, "\\r\\RVar")) {
             throw new RqlDriverError("Arguments must be RVar variables.");
         }
         $arg = new NumberDatum($arg->getId());
         unset($arg);
     }
     $this->setPositionalArg(0, new ArrayDatum($args));
     $this->setPositionalArg(1, $top);
 }
Example #2
0
 public static function _fromJSON($json)
 {
     $result = new NumberDatum();
     $result->setValue((double) $json);
     return $result;
 }
Example #3
0
 public static function _fromProtobuffer(pb\Datum $datum)
 {
     $val = $datum->getRNum();
     $result = new NumberDatum();
     $result->setValue($val);
     return $result;
 }