Permalink
Browse files

Finished documenting

  • Loading branch information...
localgod committed Jun 4, 2012
1 parent fa97b21 commit a25ed945370a455457328d008511de0a0b4f1c23
View
@@ -10,24 +10,85 @@
* @since 2012-06-01
*/
/**
- * {MISSING}
+ * An object that can be used to store or retrieve binary data from the database.
+ *
+ * The maximum size of a single object that can be inserted into the database is 4Mb.
+ * For data that is larger than this (movies, music, Henry Kissinger's autobiography),
+ * use MongoGridFS. For data that is smaller than 4Mb, it's probably be easier to just
+ * embed it into the document using MongoBinData.
*
* @category Stub
* @package Mongo
* @author Johannes Skov Frandsen <localgod@heaven.dk>
- */
-class MongoBinData {
- /**
- * Creates a new binary data object.
- * @param string $data
- * @param int $type
+ */
+class MongoBinData {
+
+ /**
+ * Function
+ * @var integer
+ */
+ const FUNC = 1;
+
+ /**
+ * Array of bytes.
+ * @var integer
+ */
+ const BYTE_ARRAY = 2;
+
+ /**
+ * Universally unique identifier.
+ * @var integer
+ */
+ const UUID = 3;
+
+ /**
+ * MD5.
+ * @var integer
*/
- public function __construct($data,$type) {
- }
- /**
- * The string representation of this binary data object.
- * @return string
+ const MD5 = 5;
+
+ /**
+ * User-defined type.
+ * @var integer
*/
- public function __toString() {
- }
+ const CUSTOM = 128;
+
+ /**
+ * {missing}
+ * @var string
+ */
+ public $bin;
+
+ /**
+ * {missing}
+ * @var integer
+ */
+ public $type = 2;
+
+ /**
+ * Creates a new binary data object.
+ *
+ * There are five types of binary data currently recognized by the BSON spec:
+ * function (0x01), byte array (0x02), UUID (0x03), MD5 (0x05), and user defined (0x80).
+ *
+ * The default type is byte array (0x02). There is no particular difference in how the driver
+ * or server interpret different types, so by and large they are irrelevant for now. Any number
+ * (between 0 and 255) could be used for type, if the user is willing to assume the risk that the
+ * database might eventually do something with binary data based on type.
+ *
+ * @param string $data Binary data.
+ * @param integer $type Data type.
+ *
+ * @return void
+ */
+ public function __construct($data,$type) {
+ }
+ /**
+ * The string representation of this binary data object.
+ *
+ * @return string "<Mongo Binary Data>". To access the contents of a MongoBinData, use the bin field.
+ */
+ public function __toString() {
+
+ }
}
View
@@ -10,24 +10,31 @@
* @since 2012-06-01
*/
/**
- * {MISSING}
+ * Represents JavaScript code for the database.
+ *
+ * MongoCode objects are composed of two parts: a string of code and an optional scope.
+ * The string of code must be valid JavaScript. The scope is a associative array of variable name/value pairs.
*
* @category Stub
* @package Mongo
* @author Johannes Skov Frandsen <localgod@heaven.dk>
- */
-class MongoCode {
- /**
- * Creates a new code object
- * @param string $code
- * @param array $scope
- */
- public function __construct($code,$scope) {
- }
- /**
- * Returns this code as a string
- * @return string
- */
- public function __toString() {
- }
+ */
+class MongoCode {
+ /**
+ * Creates a new code object
+ *
+ * @param string $code A string of code.
+ * @param array $scope The scope to use for the code.
+ *
+ * @return void
+ */
+ public function __construct($code,$scope) {
+ }
+ /**
+ * Returns this code as a string
+ *
+ * @return string This code, the scope is not returned.
+ */
+ public function __toString() {
+ }
}
Oops, something went wrong.

0 comments on commit a25ed94

Please sign in to comment.