1 | <?php |
||
24 | class MongoBinData implements TypeInterface |
||
25 | { |
||
26 | /** |
||
27 | * Generic binary data. |
||
28 | * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom |
||
29 | */ |
||
30 | const GENERIC = 0x0; |
||
31 | |||
32 | /** |
||
33 | * Function |
||
34 | * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.func |
||
35 | */ |
||
36 | const FUNC = 0x1; |
||
37 | |||
38 | /** |
||
39 | * Generic binary data (deprecated in favor of MongoBinData::GENERIC) |
||
40 | * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.byte-array |
||
41 | */ |
||
42 | const BYTE_ARRAY = 0x2; |
||
43 | |||
44 | /** |
||
45 | * Universally unique identifier (deprecated in favor of MongoBinData::UUID_RFC4122) |
||
46 | * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.uuid |
||
47 | */ |
||
48 | const UUID = 0x3; |
||
49 | |||
50 | /** |
||
51 | * Universally unique identifier (according to » RFC 4122) |
||
52 | * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom |
||
53 | */ |
||
54 | const UUID_RFC4122 = 0x4; |
||
55 | |||
56 | |||
57 | /** |
||
58 | * MD5 |
||
59 | * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.md5 |
||
60 | */ |
||
61 | const MD5 = 0x5; |
||
62 | |||
63 | /** |
||
64 | * User-defined type |
||
65 | * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom |
||
66 | */ |
||
67 | const CUSTOM = 0x80; |
||
68 | |||
69 | |||
70 | /** |
||
71 | * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.props.bin |
||
72 | * @var $bin |
||
73 | */ |
||
74 | public $bin; |
||
75 | |||
76 | /** |
||
77 | * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.props.type |
||
78 | * @var $type |
||
79 | */ |
||
80 | public $type; |
||
81 | |||
82 | /** |
||
83 | * Creates a new binary data object. |
||
84 | * |
||
85 | * @link http://php.net/manual/en/mongobindata.construct.php |
||
86 | * @param string $data Binary data |
||
87 | * @param int $type Data type |
||
88 | */ |
||
89 | public function __construct($data, $type = 2) |
||
99 | |||
100 | /** |
||
101 | * Returns the string "<Mongo Binary Data>". To access the contents of a MongoBinData, use the bin field. |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function __toString() |
||
109 | |||
110 | /** |
||
111 | * Converts this MongoBinData to the new BSON Binary type |
||
112 | * |
||
113 | * @return Binary |
||
114 | * @internal This method is not part of the ext-mongo API |
||
115 | */ |
||
116 | public function toBSONType() |
||
120 | } |
||
121 |