public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('TFetchResultsReq'); if ($this->operationHandle !== null) { if (!is_object($this->operationHandle)) { throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); } $xfer += $output->writeFieldBegin('operationHandle', TType::STRUCT, 1); $xfer += $this->operationHandle->write($output); $xfer += $output->writeFieldEnd(); } if ($this->orientation !== null) { $xfer += $output->writeFieldBegin('orientation', TType::I32, 2); $xfer += $output->writeI32($this->orientation); $xfer += $output->writeFieldEnd(); } if ($this->maxRows !== null) { $xfer += $output->writeFieldBegin('maxRows', TType::I64, 3); $xfer += $output->writeI64($this->maxRows); $xfer += $output->writeFieldEnd(); } if ($this->fetchType !== null) { $xfer += $output->writeFieldBegin('fetchType', TType::I16, 4); $xfer += $output->writeI16($this->fetchType); $xfer += $output->writeFieldEnd(); } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; }
public function __construct($vals = null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array(1 => array('var' => 'operationId', 'type' => TType::STRUCT, 'class' => 'THandleIdentifier'), 2 => array('var' => 'operationType', 'type' => TType::I32), 3 => array('var' => 'hasResultSet', 'type' => TType::BOOL), 4 => array('var' => 'modifiedRowCount', 'type' => TType::DOUBLE)); } if (is_array($vals)) { if (isset($vals['operationId'])) { $this->operationId = $vals['operationId']; } if (isset($vals['operationType'])) { $this->operationType = $vals['operationType']; } if (isset($vals['hasResultSet'])) { $this->hasResultSet = $vals['hasResultSet']; } if (isset($vals['modifiedRowCount'])) { $this->modifiedRowCount = $vals['modifiedRowCount']; } } }