diff --git a/docs/api/MongoDB/Command/Command.php b/docs/api/MongoDB/Command/Command.php index 8b7af547..25409561 100644 --- a/docs/api/MongoDB/Command/Command.php +++ b/docs/api/MongoDB/Command/Command.php @@ -10,6 +10,8 @@ final class Command private $document; /** + * Constructs a new MongoDB Command + * * @param array|object $document Command document */ public function __construct($document) diff --git a/docs/api/MongoDB/Command/CommandCursor.php b/docs/api/MongoDB/Command/CommandCursor.php index 162707df..2ef540d1 100644 --- a/docs/api/MongoDB/Command/CommandCursor.php +++ b/docs/api/MongoDB/Command/CommandCursor.php @@ -24,6 +24,8 @@ final class CommandCursor implements Cursor private $firstBatch; /** + * Constructs a new CommandCursor object + * * @param Server $server * @param CursorId $cursorId * @param array $firstBatch @@ -36,6 +38,8 @@ final class CommandCursor implements Cursor } /** + * Returns the CursorId + * * @return CursorId */ public function getId() @@ -44,6 +48,8 @@ final class CommandCursor implements Cursor } /** + * Returns the Server Object that this cursor is attached to + * * @return Server Server from which the cursor originated */ public function getServer() @@ -52,6 +58,8 @@ final class CommandCursor implements Cursor } /** + * Checks if a cursor is still alive + * * @return boolean Whether the cursor is exhausted and has no more results */ public function isDead() @@ -60,7 +68,10 @@ final class CommandCursor implements Cursor } /** + * Sets a batchsize for the cursor + * * @param integer $batchSize + * @return boolean true on success, false on failure */ public function setBatchSize($batchSize) { diff --git a/docs/api/MongoDB/Command/CommandResult.php b/docs/api/MongoDB/Command/CommandResult.php index 013102bb..9c74d3f7 100644 --- a/docs/api/MongoDB/Command/CommandResult.php +++ b/docs/api/MongoDB/Command/CommandResult.php @@ -13,6 +13,8 @@ final class CommandResult private $responseDocument; /** + * Constructs a new CommandResult + * * @param Server $server * @param array|object $responseDocument */ @@ -23,6 +25,8 @@ final class CommandResult } /** + * Returns the original response document from the server + * * @return array Original response document from the server */ public function getResponseDocument() @@ -31,6 +35,8 @@ final class CommandResult } /** + * Returns the Server Object that this cursor is attached to + * * @return Server Server from which the result originated */ public function getServer() diff --git a/docs/api/MongoDB/Cursor.php b/docs/api/MongoDB/Cursor.php index c920a281..3b5424e8 100644 --- a/docs/api/MongoDB/Cursor.php +++ b/docs/api/MongoDB/Cursor.php @@ -5,22 +5,31 @@ namespace MongoDB; interface Cursor extends \Iterator { /** + * Returns the CursorId + * * @return CursorId */ function getId(); /** + * Returns the Server Object that this cursor is attached to + * * @return Server Server from which the cursor originated */ function getServer(); /** + * Checks if a cursor is still alive + * * @return boolean Whether the cursor is exhausted and has no more results */ function isDead(); /** + * Sets the BatchSize of the Cursor + * * @param integer $batchSize + * @return boolean true on success, false on failure */ function setBatchSize($batchSize); } diff --git a/docs/api/MongoDB/CursorId.php b/docs/api/MongoDB/CursorId.php index ed34524f..b8a84fcc 100644 --- a/docs/api/MongoDB/CursorId.php +++ b/docs/api/MongoDB/CursorId.php @@ -13,6 +13,8 @@ final class CursorId // $id is an internal uint64_t value instead of a class property /** + * Construct a new CursorId + * * @param string $id */ public function __construct($id) @@ -21,6 +23,8 @@ final class CursorId } /** + * Returns the string representation of the CursorId + * * @return string */ public function __toString() diff --git a/docs/api/MongoDB/Query/Query.php b/docs/api/MongoDB/Query/Query.php index e22dcc28..272b4927 100644 --- a/docs/api/MongoDB/Query/Query.php +++ b/docs/api/MongoDB/Query/Query.php @@ -28,6 +28,8 @@ final class Query private $limit; /** + * Constructs a new Query + * * @param array|object $query Query document * @param array|object $selector Selector document * @param integer $flags Query flags diff --git a/docs/api/MongoDB/Query/QueryCursor.php b/docs/api/MongoDB/Query/QueryCursor.php index 55880f10..3b98cd87 100644 --- a/docs/api/MongoDB/Query/QueryCursor.php +++ b/docs/api/MongoDB/Query/QueryCursor.php @@ -34,6 +34,8 @@ final class QueryCursor implements Cursor } /** + * Returns the CursorId + * * @return CursorId */ public function getId() @@ -42,6 +44,8 @@ final class QueryCursor implements Cursor } /** + * Returns the Server Object that this cursor is attached to + * * @return Server Server from which the cursor originated */ public function getServer() @@ -50,6 +54,8 @@ final class QueryCursor implements Cursor } /** + * Checks if a cursor is still alive + * * @return boolean Whether the cursor is exhausted and has no more results */ public function isDead() @@ -58,7 +64,10 @@ final class QueryCursor implements Cursor } /** + * Sets a batchsize for the cursor + * * @param integer $batchSize + * @return boolean true on success, false on failure */ public function setBatchSize($batchSize) { diff --git a/docs/api/MongoDB/ReadPreference.php b/docs/api/MongoDB/ReadPreference.php index 69201aa7..a374abdd 100644 --- a/docs/api/MongoDB/ReadPreference.php +++ b/docs/api/MongoDB/ReadPreference.php @@ -17,6 +17,8 @@ final class ReadPreference private $tagSets; /** + * Constructs a new ReadPreference + * * @param string $readPreference Read preference name * @param array[] $tagSets Array of zero or more tag sets (i.e. tag criteria) */ diff --git a/docs/api/MongoDB/Server.php b/docs/api/MongoDB/Server.php index 3074d260..8f9cf93c 100644 --- a/docs/api/MongoDB/Server.php +++ b/docs/api/MongoDB/Server.php @@ -36,6 +36,8 @@ final class Server private $driverOptions; /** + * Constructs a new Server + * * @param string $host Server host * @param integer $port Server port * @param array $options Connection options (e.g. auth, socket timeouts) @@ -59,6 +61,8 @@ final class Server } /** + * Executes a command on this server + * * @param string $db * @param Command $command * @return CommandResult @@ -72,6 +76,8 @@ final class Server } /** + * Executes a Query + * * @param string $namespace * @param Query $query * @return QueryCursor @@ -85,6 +91,8 @@ final class Server } /** + * Executes a write operation batch (e.g. insert, update, delete) + * * @param string $namespace * @param WriteBatch $batch * @return WriteResult @@ -107,6 +115,11 @@ final class Server */ } + /** + * Returns the hostname used to connect to this Server + * + * @return string + */ public function getHost() { /* This does not return the host name from isMaster, since the "me" @@ -118,6 +131,8 @@ final class Server } /** + * Returns the last isMaster() result document + * * @return array Connection metadata (e.g. min/maxWireVersion, RS hosts) */ public function getInfo() @@ -126,6 +141,8 @@ final class Server } /** + * Returns the last messured latency + * * @return integer Server latency in milliseconds */ public function getLatency() @@ -134,6 +151,8 @@ final class Server } /** + * Returns the port used to create this Server + * * @return integer */ public function getPort() @@ -142,12 +161,14 @@ final class Server } /** - * @see http://docs.mongodb.org/manual/reference/replica-states/ + * Returns the current state of the node (maintenece/startup/...) + * * @return integer Replica set node state */ public function getState() { /* Return the replica set node's state via replSetGetStatus + * http://docs.mongodb.org/manual/reference/replica-states/ * * We may want to create class constants for documented states. * @@ -156,6 +177,8 @@ final class Server } /** + * Returns the node type of this Server + * * @return integer Server type code */ public function getType() @@ -168,6 +191,11 @@ final class Server */ } + /** + * Checks if this is a special "delayed" member of a RepilcaSet + * + * @return bool true if delayed node, false otherwise + */ public function isDelayed() { /* Return whether the secondary is delayed. @@ -179,6 +207,11 @@ final class Server */ } + /** + * Checks if this is a special passive node member of a ReplicaSet + * + * @return bool true if this node is passive, false otherwise + */ public function isPassive() { /* Return inferred value from isMaster data. diff --git a/docs/api/MongoDB/Write/DeleteBatch.php b/docs/api/MongoDB/Write/DeleteBatch.php index ca9e8af2..35b583d3 100644 --- a/docs/api/MongoDB/Write/DeleteBatch.php +++ b/docs/api/MongoDB/Write/DeleteBatch.php @@ -10,7 +10,10 @@ final class DeleteBatch implements WriteBatch private $documents; /** + * Adds a new operation to be executed + * * @param array|object $document Operation/document to add to the batch + * @return DeleteBatch */ public function add($document) { @@ -18,7 +21,9 @@ final class DeleteBatch implements WriteBatch } /** - * @see Countable::count() + * Returns how many items have been added to this batch + * + * @return int How many operations are total in this batch object */ public function count() { diff --git a/docs/api/MongoDB/Write/DeleteResult.php b/docs/api/MongoDB/Write/DeleteResult.php index 9b0fb215..fc3d6e92 100644 --- a/docs/api/MongoDB/Write/DeleteResult.php +++ b/docs/api/MongoDB/Write/DeleteResult.php @@ -12,27 +12,37 @@ namespace MongoDB\Write; final class DeleteResult implements WriteResult { /** + * Returns the Number of documents that got removed + * * @return integer */ public function getNumRemoved() {} /** - * @see WriteResult::getInfo() + * Returns metadata about the operation, see https://github.com/mongodb/specifications/blob/master/source/server_write_commands.rst#situational-fields + * + * @return array Additional metadata for the operation(s) (e.g. lastOp) */ public function getInfo() {} /** - * @see WriteResult::getServer() + * Returns the Server object that this result originated + * + * @return Server Server from which the result originated */ public function getServer() {} /** - * @see WriteResult::getWriteConcernErrors() + * Returns all WriteConcern Errors that occurred + * + * @return WriteConcernError[] */ public function getWriteConcernErrors() {} /** - * @see WriteResult::getWriteErrors() + * Returns all Write Errors that occurred + * + * @return WriteError[] */ public function getWriteErrors() {} } diff --git a/docs/api/MongoDB/Write/GeneratedId.php b/docs/api/MongoDB/Write/GeneratedId.php index bb7426b1..e5bb2bc0 100644 --- a/docs/api/MongoDB/Write/GeneratedId.php +++ b/docs/api/MongoDB/Write/GeneratedId.php @@ -12,6 +12,8 @@ final class GeneratedId private $index; /** + * Constructs a new GeneratedId + * * @param mixed $id Document identifier * @param integer $index Batch index of the corresponding operation */ @@ -22,6 +24,8 @@ final class GeneratedId } /** + * Returns the GeneratedId + * * @return mixed Document identifier */ public function getId() @@ -30,6 +34,8 @@ final class GeneratedId } /** + * Returns the batch index + * * @return integer Batch index of the corresponding operation */ public function getIndex() diff --git a/docs/api/MongoDB/Write/InsertBatch.php b/docs/api/MongoDB/Write/InsertBatch.php index 973f8d7e..c918384e 100644 --- a/docs/api/MongoDB/Write/InsertBatch.php +++ b/docs/api/MongoDB/Write/InsertBatch.php @@ -10,7 +10,10 @@ final class InsertBatch implements WriteBatch private $documents; /** + * Adds a new operation to be executed + * * @param array|object $document Operation/document to add to the batch + * @return InsertBatch */ public function add($document) { @@ -18,7 +21,9 @@ final class InsertBatch implements WriteBatch } /** - * @see Countable::count() + * Returns how many items have been added to this batch + * + * @return int How many operations are total in this batch object */ public function count() { diff --git a/docs/api/MongoDB/Write/InsertResult.php b/docs/api/MongoDB/Write/InsertResult.php index fc01261d..617bf6d5 100644 --- a/docs/api/MongoDB/Write/InsertResult.php +++ b/docs/api/MongoDB/Write/InsertResult.php @@ -12,11 +12,15 @@ namespace MongoDB\Write; final class InsertResult implements WriteResult { /** + * Returns the Number of documents that where inserted + * * @return integer */ public function getNumInserted() {} /** + * Returns all generated IDs + * * @return GeneratedId[] */ public function getGeneratedIds() @@ -29,22 +33,30 @@ final class InsertResult implements WriteResult } /** - * @see WriteResult::getInfo() + * Returns metadata about the operation, see https://github.com/mongodb/specifications/blob/master/source/server_write_commands.rst#situational-fields + * + * @return array Additional metadata for the operation(s) (e.g. lastOp) */ public function getInfo() {} /** - * @see WriteResult::getServer() + * Returns the Server object that this result originated + * + * @return Server Server from which the result originated */ public function getServer() {} /** - * @see WriteResult::getWriteConcernErrors() + * Returns all WriteConcern Errors that occurred + * + * @return WriteConcernError[] */ public function getWriteConcernErrors() {} /** - * @see WriteResult::getWriteErrors() + * Returns all Write Errors that occurred + * + * @return WriteError[] */ public function getWriteErrors() {} } diff --git a/docs/api/MongoDB/Write/UpdateBatch.php b/docs/api/MongoDB/Write/UpdateBatch.php index 172b8189..0aaebb55 100644 --- a/docs/api/MongoDB/Write/UpdateBatch.php +++ b/docs/api/MongoDB/Write/UpdateBatch.php @@ -10,7 +10,10 @@ final class UpdateBatch implements WriteBatch private $documents; /** + * Adds a new operation to be executed + * * @param array|object $document Operation/document to add to the batch + * @return UpdateBatch */ public function add($document) { @@ -18,7 +21,9 @@ final class UpdateBatch implements WriteBatch } /** - * @see Countable::count() + * Returns how many items have been added to this batch + * + * @return int How many operations are total in this batch object */ public function count() { diff --git a/docs/api/MongoDB/Write/UpdateResult.php b/docs/api/MongoDB/Write/UpdateResult.php index cb5730e2..677d12fb 100644 --- a/docs/api/MongoDB/Write/UpdateResult.php +++ b/docs/api/MongoDB/Write/UpdateResult.php @@ -12,21 +12,29 @@ namespace MongoDB\Write; final class UpdateResult implements WriteResult { /** + * Returns the number of documents matching the criteria + * * @return integer */ public function getNumMatched() {} /** + * Returns the number of documents that got physically modified + * * @return integer */ public function getNumModified() {} /** + * Returns the number of new documentes + * * @return integer */ public function getNumUpserted() {} /** + * Returns the GeneratedIds of the upserted documents + * * @return GeneratedId[] */ public function getUpserts() @@ -37,22 +45,30 @@ final class UpdateResult implements WriteResult } /** - * @see WriteResult::getInfo() + * Returns metadata about the operation, see https://github.com/mongodb/specifications/blob/master/source/server_write_commands.rst#situational-fields + * + * @return array Additional metadata for the operation(s) (e.g. lastOp) */ public function getInfo() {} /** - * @see WriteResult::getServer() + * Returns the Server object that this result originated + * + * @return Server Server from which the result originated */ public function getServer() {} /** - * @see WriteResult::getWriteConcernErrors() + * Returns all WriteConcern Errors that occurred + * + * @return WriteConcernError[] */ public function getWriteConcernErrors() {} /** - * @see WriteResult::getWriteErrors() + * Returns all Write Errors that occurred + * + * @return WriteError[] */ public function getWriteErrors() {} } diff --git a/docs/api/MongoDB/Write/WriteBatch.php b/docs/api/MongoDB/Write/WriteBatch.php index d8f3dded..1a7a81f4 100644 --- a/docs/api/MongoDB/Write/WriteBatch.php +++ b/docs/api/MongoDB/Write/WriteBatch.php @@ -5,7 +5,10 @@ namespace MongoDB\Write; interface WriteBatch extends \Countable { /** + * Adds a new operation to be executed + * * @param array|object $document Operation/document to add to the batch + * @return DeleteBatch */ function add($document); } diff --git a/docs/api/MongoDB/Write/WriteConcernError.php b/docs/api/MongoDB/Write/WriteConcernError.php index 5f510f22..3a7fd0e9 100644 --- a/docs/api/MongoDB/Write/WriteConcernError.php +++ b/docs/api/MongoDB/Write/WriteConcernError.php @@ -12,6 +12,8 @@ final class WriteConcernError private $info; /** + * Constructs a new WriteConcernError object + * * @param string $message Server error message * @param integer $code Server error code * @param array $info Additional metadat for the error (e.g. {"wtimeout": true}) @@ -24,6 +26,8 @@ final class WriteConcernError } /** + * Returns the MongoDB error code + * * @return integer Server error code */ public function getCode() @@ -32,6 +36,8 @@ final class WriteConcernError } /** + * Returns additional metadata for the error + * * @return array Additional metadata for the error (e.g. {"wtimeout": true}) */ public function getInfo() @@ -40,6 +46,8 @@ final class WriteConcernError } /** + * Returns the actual error message from the server + * * @return string Server error message */ public function getMessage() diff --git a/docs/api/MongoDB/Write/WriteError.php b/docs/api/MongoDB/Write/WriteError.php index 497cc52f..9ea611d9 100644 --- a/docs/api/MongoDB/Write/WriteError.php +++ b/docs/api/MongoDB/Write/WriteError.php @@ -13,6 +13,8 @@ final class WriteError private $operation; /** + * Constructs a new WriteError object + * * @param string $message Server error message * @param integer $code Server error code * @param integer $index Batch index of the error @@ -27,6 +29,8 @@ final class WriteError } /** + * Returns the MongoDB error code + * * @return integer Server error code */ public function getCode() @@ -35,6 +39,8 @@ final class WriteError } /** + * Returns the Batch index where this WriteError occurred in + * * @return integer Batch index of the error */ public function getIndex() @@ -43,6 +49,8 @@ final class WriteError } /** + * Returns the actual error message from the server + * * @return string Server error message */ public function getMessage() @@ -51,6 +59,8 @@ final class WriteError } /** + * Returns the batch operation itself that caused the error + * * @return array|object Operation or document responsible for the error */ public function getOperation() diff --git a/docs/api/MongoDB/Write/WriteResult.php b/docs/api/MongoDB/Write/WriteResult.php index 946b964a..a0febebf 100644 --- a/docs/api/MongoDB/Write/WriteResult.php +++ b/docs/api/MongoDB/Write/WriteResult.php @@ -5,22 +5,29 @@ namespace MongoDB\Write; interface WriteResult { /** - * @see https://github.com/mongodb/specifications/blob/master/source/server_write_commands.rst#situational-fields + * Returns metadata about the operation, see https://github.com/mongodb/specifications/blob/master/source/server_write_commands.rst#situational-fields + * * @return array Additional metadata for the operation(s) (e.g. lastOp) */ function getInfo(); /** + * Returns the Server object that this result originated + * * @return Server Server from which the result originated */ function getServer(); /** + * Returns all WriteConcern Errors that occurred + * * @return WriteConcernError[] */ function getWriteConcernErrors(); /** + * Returns all Write Errors that occurred + * * @return WriteError[] */ function getWriteErrors();