Commit 2f63218a authored by Jeremy Mikola's avatar Jeremy Mikola

PHPLIB-70: Add class-level docs to model iterators

parent 7191886d
......@@ -4,6 +4,17 @@ namespace MongoDB\Model;
use IteratorIterator;
/**
* CollectionInfoIterator for listCollections command results.
*
* This iterator may be used to wrap a Cursor returned by the listCollections
* command.
*
* @internal
* @see MongoDB\Database::listCollections()
* @see https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst
* @see http://docs.mongodb.org/manual/reference/command/listCollections/
*/
class CollectionInfoCommandIterator extends IteratorIterator implements CollectionInfoIterator
{
/**
......
......@@ -4,6 +4,14 @@ namespace MongoDB\Model;
use Iterator;
/**
* CollectionInfoIterator interface.
*
* This iterator is used for enumerating collections in a database.
*
* @api
* @see MongoDB\Database::listCollections()
*/
interface CollectionInfoIterator extends Iterator
{
/**
......
......@@ -7,6 +7,20 @@ use Iterator;
use IteratorIterator;
use Traversable;
/**
* CollectionInfoIterator for legacy "system.namespaces" query results.
*
* This iterator may be used to wrap a Cursor returned for queries on the
* "system.namespaces" collection. It includes logic to filter out internal
* collections and modify the collection name to be consistent with results from
* the listCollections command.
*
* @internal
* @see MongoDB\Database::listCollections()
* @see https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst
* @see http://docs.mongodb.org/manual/reference/command/listCollections/
* @see http://docs.mongodb.org/manual/reference/system-collections/
*/
class CollectionInfoLegacyIterator extends FilterIterator implements CollectionInfoIterator
{
/**
......
......@@ -4,6 +4,14 @@ namespace MongoDB\Model;
use Iterator;
/**
* DatabaseInfoIterator interface.
*
* This iterator is used for enumerating databases on a server.
*
* @api
* @see MongoDB\Client::listDatabases()
*/
interface DatabaseInfoIterator extends Iterator
{
/**
......
......@@ -2,6 +2,16 @@
namespace MongoDB\Model;
/**
* DatabaseInfoIterator for inline listDatabases command results.
*
* This iterator may be used to wrap the array returned within the listDatabases
* command's single-document result.
*
* @internal
* @see MongoDB\Client::listDatabases()
* @see http://docs.mongodb.org/manual/reference/command/listDatabases/
*/
class DatabaseInfoLegacyIterator implements DatabaseInfoIterator
{
private $databases;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment