MongoBinData.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. /*
  3. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  4. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  5. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  6. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  11. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  13. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. */
  15. class MongoBinData {
  16. /**
  17. * Generic binary data.
  18. * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom
  19. */
  20. const GENERIC = 0x0;
  21. /**
  22. * Function
  23. * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.func
  24. */
  25. const FUNC = 0x1;
  26. /**
  27. * Generic binary data (deprecated in favor of MongoBinData::GENERIC)
  28. * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.byte-array
  29. */
  30. const BYTE_ARRAY = 0x2;
  31. /**
  32. * Universally unique identifier (deprecated in favor of MongoBinData::UUID_RFC4122)
  33. * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.uuid
  34. */
  35. const UUID = 0x3;
  36. /**
  37. * Universally unique identifier (according to » RFC 4122)
  38. * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom
  39. */
  40. const UUID_RFC4122 = 0x4;
  41. /**
  42. * MD5
  43. * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.md5
  44. */
  45. const MD5 = 0x5;
  46. /**
  47. * User-defined type
  48. * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom
  49. */
  50. const CUSTOM = 0x80;
  51. /**
  52. * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.props.bin
  53. * @var $bin
  54. */
  55. public $bin;
  56. /**
  57. * @link http://php.net/manual/en/class.mongobindata.php#mongobindata.props.type
  58. * @var $type
  59. */
  60. public $type;
  61. /**
  62. * Creates a new binary data object.
  63. *
  64. * @link http://php.net/manual/en/mongobindata.construct.php
  65. * @param string $data Binary data
  66. * @param int $type Data type
  67. * @return MongoBinData Returns a new binary data object
  68. */
  69. public function __construct($data, $type = 2) {}
  70. /**
  71. * Returns the string representation of this binary data object.
  72. * @return string
  73. */
  74. public function __toString() {}
  75. }