Ejemplo n.º 1
0
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('TGetInfoResp');
     if ($this->status !== null) {
         if (!is_object($this->status)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('status', TType::STRUCT, 1);
         $xfer += $this->status->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->infoValue !== null) {
         if (!is_object($this->infoValue)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('infoValue', TType::STRUCT, 2);
         $xfer += $this->infoValue->write($output);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }
Ejemplo n.º 2
0
 public function __construct($vals = null)
 {
     if (!isset(self::$_TSPEC)) {
         self::$_TSPEC = array(1 => array('var' => 'stringValue', 'type' => TType::STRING), 2 => array('var' => 'smallIntValue', 'type' => TType::I16), 3 => array('var' => 'integerBitmask', 'type' => TType::I32), 4 => array('var' => 'integerFlag', 'type' => TType::I32), 5 => array('var' => 'binaryValue', 'type' => TType::I32), 6 => array('var' => 'lenValue', 'type' => TType::I64));
     }
     if (is_array($vals)) {
         if (isset($vals['stringValue'])) {
             $this->stringValue = $vals['stringValue'];
         }
         if (isset($vals['smallIntValue'])) {
             $this->smallIntValue = $vals['smallIntValue'];
         }
         if (isset($vals['integerBitmask'])) {
             $this->integerBitmask = $vals['integerBitmask'];
         }
         if (isset($vals['integerFlag'])) {
             $this->integerFlag = $vals['integerFlag'];
         }
         if (isset($vals['binaryValue'])) {
             $this->binaryValue = $vals['binaryValue'];
         }
         if (isset($vals['lenValue'])) {
             $this->lenValue = $vals['lenValue'];
         }
     }
 }