public function __construct($vals = null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array(1 => array('var' => 'name', 'type' => TType::STRING), 2 => array('var' => 'strategy_class', 'type' => TType::STRING), 3 => array('var' => 'strategy_options', 'type' => TType::MAP, 'ktype' => TType::STRING, 'vtype' => TType::STRING, 'key' => array('type' => TType::STRING), 'val' => array('type' => TType::STRING)), 4 => array('var' => 'replication_factor', 'type' => TType::I32), 5 => array('var' => 'cf_defs', 'type' => TType::LST, 'etype' => TType::STRUCT, 'elem' => array('type' => TType::STRUCT, 'class' => 'cassandra_CfDef'))); } if (is_array($vals)) { if (isset($vals['name'])) { $this->name = $vals['name']; } if (isset($vals['strategy_class'])) { $this->strategy_class = $vals['strategy_class']; } if (isset($vals['strategy_options'])) { $this->strategy_options = $vals['strategy_options']; } if (isset($vals['replication_factor'])) { $this->replication_factor = $vals['replication_factor']; } if (isset($vals['cf_defs'])) { $this->cf_defs = $vals['cf_defs']; } } }
public function read($input) { $xfer = 0; $fname = null; $ftype = 0; $fid = 0; $xfer += $input->readStructBegin($fname); while (true) { $xfer += $input->readFieldBegin($fname, $ftype, $fid); if ($ftype == TType::STOP) { break; } switch ($fid) { case 0: if ($ftype == TType::LST) { $this->success = array(); $_size168 = 0; $_etype171 = 0; $xfer += $input->readListBegin($_etype171, $_size168); for ($_i172 = 0; $_i172 < $_size168; ++$_i172) { $elem173 = null; $elem173 = new cassandra_KsDef(); $xfer += $elem173->read($input); $this->success[] = $elem173; } $xfer += $input->readListEnd(); } else { $xfer += $input->skip($ftype); } break; case 1: if ($ftype == TType::STRUCT) { $this->ire = new cassandra_InvalidRequestException(); $xfer += $this->ire->read($input); } else { $xfer += $input->skip($ftype); } break; default: $xfer += $input->skip($ftype); break; } $xfer += $input->readFieldEnd(); } $xfer += $input->readStructEnd(); return $xfer; }