Пример #1
0
 public function __construct($vals = null)
 {
     if (!isset(self::$_TSPEC)) {
         self::$_TSPEC = array(1 => array('var' => 'status', 'type' => TType::STRUCT, 'class' => '\\TStatus'), 2 => array('var' => 'serverProtocolVersion', 'type' => TType::I32), 3 => array('var' => 'sessionHandle', 'type' => TType::STRUCT, 'class' => '\\TSessionHandle'), 4 => array('var' => 'configuration', 'type' => TType::MAP, 'ktype' => TType::STRING, 'vtype' => TType::STRING, 'key' => array('type' => TType::STRING), 'val' => array('type' => TType::STRING)));
     }
     if (is_array($vals)) {
         if (isset($vals['status'])) {
             $this->status = $vals['status'];
         }
         if (isset($vals['serverProtocolVersion'])) {
             $this->serverProtocolVersion = $vals['serverProtocolVersion'];
         }
         if (isset($vals['sessionHandle'])) {
             $this->sessionHandle = $vals['sessionHandle'];
         }
         if (isset($vals['configuration'])) {
             $this->configuration = $vals['configuration'];
         }
     }
 }
Пример #2
0
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('TCLIService_OpenSession_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();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }