public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('ThriftHive_getQueryPlan_result'); if ($this->success !== null) { if (!is_object($this->success)) { throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); } $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); $xfer += $this->success->write($output); $xfer += $output->writeFieldEnd(); } if ($this->ex !== null) { $xfer += $output->writeFieldBegin('ex', TType::STRUCT, 1); $xfer += $this->ex->write($output); $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' => 'queries', 'type' => TType::LST, 'etype' => TType::STRUCT, 'elem' => array('type' => TType::STRUCT, 'class' => '\\Query')), 2 => array('var' => 'done', 'type' => TType::BOOL), 3 => array('var' => 'started', 'type' => TType::BOOL)); } if (is_array($vals)) { if (isset($vals['queries'])) { $this->queries = $vals['queries']; } if (isset($vals['done'])) { $this->done = $vals['done']; } if (isset($vals['started'])) { $this->started = $vals['started']; } } }