Example #1
0
 public static function _fromJSON($json)
 {
     $jsonArray = array_values((array) $json);
     foreach ($jsonArray as &$val) {
         $val = decodedJSONToDatum($val);
         unset($val);
     }
     $result = new ArrayDatum();
     $result->setValue($jsonArray);
     return $result;
 }
Example #2
0
 public static function _fromProtobuffer(pb\Datum $datum)
 {
     $size = $datum->getRArrayCount();
     $val = array();
     for ($i = 0; $i < $size; ++$i) {
         $v = protobufToDatum($datum->getRArrayAt($i));
         $val[$i] = $v;
     }
     $result = new ArrayDatum();
     $result->setValue($val);
     return $result;
 }