1: <?php
2: namespace phpcassa\Schema\DataType;
3:
4: /**
5: * Stores data as an 4-byte signed integer.
6: *
7: * @package phpcassa\Schema\DataType
8: */
9: class Int32Type extends CassandraType {
10:
11: public function pack($value, $is_name=null, $slice_end=null, $is_data=null)
12: {
13: // signed/unsigned doesn't matter when packing
14: return pack('N', $value);
15: }
16:
17: public function unpack($data, $is_name=null)
18: {
19: return current(unpack('l', strrev($data)));
20: }
21: }
22:
23: