| | 235 | |
| | 236 | = 補充 = |
| | 237 | |
| | 238 | == TCell == |
| | 239 | {{{ |
| | 240 | #!php |
| | 241 | <? |
| | 242 | class TCell { |
| | 243 | static $_TSPEC; |
| | 244 | |
| | 245 | public $value = null; |
| | 246 | public $timestamp = null; |
| | 247 | |
| | 248 | public function __construct($vals=null) { |
| | 249 | if (!isset(self::$_TSPEC)) { |
| | 250 | self::$_TSPEC = array( |
| | 251 | 1 => array( |
| | 252 | 'var' => 'value', |
| | 253 | 'type' => TType::STRING, |
| | 254 | ), |
| | 255 | 2 => array( |
| | 256 | 'var' => 'timestamp', |
| | 257 | 'type' => TType::I64, |
| | 258 | ), |
| | 259 | ); |
| | 260 | } |
| | 261 | if (is_array($vals)) { |
| | 262 | if (isset($vals['value'])) { |
| | 263 | $this->value = $vals['value']; |
| | 264 | } |
| | 265 | if (isset($vals['timestamp'])) { |
| | 266 | $this->timestamp = $vals['timestamp']; |
| | 267 | } |
| | 268 | } |
| | 269 | } |
| | 270 | } |
| | 271 | ?> |
| | 272 | }}} |
| | 273 | == TRowResult == |
| | 274 | {{{ |
| | 275 | #!php |
| | 276 | <? |
| | 277 | class TRowResult { |
| | 278 | static $_TSPEC; |
| | 279 | |
| | 280 | public $row = null; |
| | 281 | public $columns = null; |
| | 282 | |
| | 283 | public function __construct($vals=null) { |
| | 284 | if (!isset(self::$_TSPEC)) { |
| | 285 | self::$_TSPEC = array( |
| | 286 | 1 => array( |
| | 287 | 'var' => 'row', |
| | 288 | 'type' => TType::STRING, |
| | 289 | ), |
| | 290 | 2 => array( |
| | 291 | 'var' => 'columns', |
| | 292 | 'type' => TType::MAP, |
| | 293 | 'ktype' => TType::STRING, |
| | 294 | 'vtype' => TType::STRUCT, |
| | 295 | 'key' => array( |
| | 296 | 'type' => TType::STRING, |
| | 297 | ), |
| | 298 | 'val' => array( |
| | 299 | 'type' => TType::STRUCT, |
| | 300 | 'class' => 'TCell', |
| | 301 | ), |
| | 302 | ), |
| | 303 | ); |
| | 304 | } |
| | 305 | if (is_array($vals)) { |
| | 306 | if (isset($vals['row'])) { |
| | 307 | $this->row = $vals['row']; |
| | 308 | } |
| | 309 | if (isset($vals['columns'])) { |
| | 310 | $this->columns = $vals['columns']; |
| | 311 | } |
| | 312 | } |
| | 313 | } |
| | 314 | } |
| | 315 | ?> |
| | 316 | }}} |