public function __construct($vals = null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array(1 => array('var' => 'name', 'type' => TType::STRING), 2 => array('var' => 'id', 'type' => TType::I32)); } if (is_array($vals)) { if (isset($vals['name'])) { $this->name = $vals['name']; } if (isset($vals['id'])) { $this->id = $vals['id']; } } }
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 1: if ($ftype == TType::LST) { $this->nameIDS = array(); $_size0 = 0; $_etype3 = 0; $xfer += $input->readListBegin($_etype3, $_size0); for ($_i4 = 0; $_i4 < $_size0; ++$_i4) { $elem5 = null; $elem5 = new wtname2id_TNameID(); $xfer += $elem5->read($input); $this->nameIDS[] = $elem5; } $xfer += $input->readListEnd(); } else { $xfer += $input->skip($ftype); } break; default: $xfer += $input->skip($ftype); break; } $xfer += $input->readFieldEnd(); } $xfer += $input->readStructEnd(); return $xfer; }