1: <?php
2: namespace phpcassa\Schema\DataType;
3:
4: /**
5: * Stores data as single-byte boolean values.
6: *
7: * @package phpcassa\Schema\DataType
8: */
9: class BooleanType extends CassandraType {
10:
11: public function pack($value, $is_name=null, $slice_end=null, $is_data=null)
12: {
13: return pack('C', $value);
14: }
15:
16: public function unpack($data, $is_name=null)
17: {
18: return current(unpack('C', $data)) === 1;
19: }
20: }
21:
22: