Skip to content

Commit 225ae3c

Browse files
committed
PHPLIB-70: Add class-level docs to model iterators
1 parent af27f14 commit 225ae3c

File tree

5 files changed

+51
-0
lines changed

5 files changed

+51
-0
lines changed

src/Model/CollectionInfoCommandIterator.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44

55
use IteratorIterator;
66

7+
/**
8+
* CollectionInfoIterator for listCollections command results.
9+
*
10+
* This iterator may be used to wrap a Cursor returned by the listCollections
11+
* command.
12+
*
13+
* @internal
14+
* @see MongoDB\Database::listCollections()
15+
* @see https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst
16+
* @see http://docs.mongodb.org/manual/reference/command/listCollections/
17+
*/
718
class CollectionInfoCommandIterator extends IteratorIterator implements CollectionInfoIterator
819
{
920
/**

src/Model/CollectionInfoIterator.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
use Iterator;
66

7+
/**
8+
* CollectionInfoIterator interface.
9+
*
10+
* This iterator is used for enumerating collections in a database.
11+
*
12+
* @api
13+
* @see MongoDB\Database::listCollections()
14+
*/
715
interface CollectionInfoIterator extends Iterator
816
{
917
/**

src/Model/CollectionInfoLegacyIterator.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@
77
use IteratorIterator;
88
use Traversable;
99

10+
/**
11+
* CollectionInfoIterator for legacy "system.namespaces" query results.
12+
*
13+
* This iterator may be used to wrap a Cursor returned for queries on the
14+
* "system.namespaces" collection. It includes logic to filter out internal
15+
* collections and modify the collection name to be consistent with results from
16+
* the listCollections command.
17+
*
18+
* @internal
19+
* @see MongoDB\Database::listCollections()
20+
* @see https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst
21+
* @see http://docs.mongodb.org/manual/reference/command/listCollections/
22+
* @see http://docs.mongodb.org/manual/reference/system-collections/
23+
*/
1024
class CollectionInfoLegacyIterator extends FilterIterator implements CollectionInfoIterator
1125
{
1226
/**

src/Model/DatabaseInfoIterator.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
use Iterator;
66

7+
/**
8+
* DatabaseInfoIterator interface.
9+
*
10+
* This iterator is used for enumerating databases on a server.
11+
*
12+
* @api
13+
* @see MongoDB\Client::listDatabases()
14+
*/
715
interface DatabaseInfoIterator extends Iterator
816
{
917
/**

src/Model/DatabaseInfoLegacyIterator.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
namespace MongoDB\Model;
44

5+
/**
6+
* DatabaseInfoIterator for inline listDatabases command results.
7+
*
8+
* This iterator may be used to wrap the array returned within the listDatabases
9+
* command's single-document result.
10+
*
11+
* @internal
12+
* @see MongoDB\Client::listDatabases()
13+
* @see http://docs.mongodb.org/manual/reference/command/listDatabases/
14+
*/
515
class DatabaseInfoLegacyIterator implements DatabaseInfoIterator
616
{
717
private $databases;

0 commit comments

Comments
 (0)