public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('TColumnDesc'); if ($this->columnName !== null) { $xfer += $output->writeFieldBegin('columnName', TType::STRING, 1); $xfer += $output->writeString($this->columnName); $xfer += $output->writeFieldEnd(); } if ($this->typeDesc !== null) { if (!is_object($this->typeDesc)) { throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); } $xfer += $output->writeFieldBegin('typeDesc', TType::STRUCT, 2); $xfer += $this->typeDesc->write($output); $xfer += $output->writeFieldEnd(); } if ($this->position !== null) { $xfer += $output->writeFieldBegin('position', TType::I32, 3); $xfer += $output->writeI32($this->position); $xfer += $output->writeFieldEnd(); } if ($this->comment !== null) { $xfer += $output->writeFieldBegin('comment', TType::STRING, 4); $xfer += $output->writeString($this->comment); $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' => 'types', 'type' => TType::LST, 'etype' => TType::STRUCT, 'elem' => array('type' => TType::STRUCT, 'class' => 'TTypeEntry'))); } if (is_array($vals)) { if (isset($vals['types'])) { $this->types = $vals['types']; } } }