Skip to content

Commit 1f4373e

Browse files
committed
PHPLIB-235: Document enumeration model classes
1 parent 5630bb9 commit 1f4373e

17 files changed

+702
-0
lines changed

docs/reference.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ Reference
1313
/reference/class/MongoDBCollection
1414
/reference/class/MongoDBGridFSBucket
1515
/reference/write-result-classes
16+
/reference/enumeration-classes
1617
/reference/exception-classes
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
===================
2+
Enumeration Classes
3+
===================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
MongoDB\\Model\\CollectionInfo
14+
------------------------------
15+
16+
Definition
17+
~~~~~~~~~~
18+
19+
.. phpclass:: MongoDB\\Model\\CollectionInfo
20+
21+
This class models information about a collection. Instances of this class are
22+
returned by traversing a :phpclass:`MongoDB\\Model\\CollectionInfoIterator`,
23+
which is returned by :phpmethod:`MongoDB\\Database::listCollections()`.
24+
25+
Methods
26+
~~~~~~~
27+
28+
.. toctree::
29+
:titlesonly:
30+
31+
/reference/method/MongoDBModelCollectionInfo-getCappedMax
32+
/reference/method/MongoDBModelCollectionInfo-getCappedSize
33+
/reference/method/MongoDBModelCollectionInfo-getName
34+
/reference/method/MongoDBModelCollectionInfo-getOptions
35+
/reference/method/MongoDBModelCollectionInfo-isCapped
36+
37+
----
38+
39+
MongoDB\\Model\\CollectionInfoIterator
40+
--------------------------------------
41+
42+
Definition
43+
~~~~~~~~~~
44+
45+
.. phpclass:: MongoDB\\Model\\CollectionInfoIterator
46+
47+
This interface extends PHP's :php:`Iterator <manual/en/class.iterator.php>`
48+
interface. An instance of this interface is returned by
49+
:phpmethod:`MongoDB\\Database::listCollections()`.
50+
51+
Methods
52+
~~~~~~~
53+
54+
This interface adds no new methods to :php:`Iterator
55+
<manual/en/class.iterator.php>`, but specifies that :php:`current()
56+
<manual/en/iterator.current.php>` will return an instance of
57+
:phpclass:`MongoDB\\Model\\CollectionInfo`.
58+
59+
----
60+
61+
MongoDB\\Model\\DatabaseInfo
62+
----------------------------
63+
64+
Definition
65+
~~~~~~~~~~
66+
67+
.. phpclass:: MongoDB\\Model\\DatabaseInfo
68+
69+
This class models information about a database. Instances of this class are
70+
returned by traversing a :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`,
71+
which is returned by :phpmethod:`MongoDB\\Client::listDatabases()`.
72+
73+
Methods
74+
~~~~~~~
75+
76+
.. toctree::
77+
:titlesonly:
78+
79+
/reference/method/MongoDBModelDatabaseInfo-getName
80+
/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk
81+
/reference/method/MongoDBModelDatabaseInfo-isEmpty
82+
83+
----
84+
85+
MongoDB\\Model\\DatabaseInfoIterator
86+
------------------------------------
87+
88+
Definition
89+
~~~~~~~~~~
90+
91+
.. phpclass:: MongoDB\\Model\\DatabaseInfoIterator
92+
93+
This interface extends PHP's :php:`Iterator <manual/en/class.iterator.php>`
94+
interface. An instance of this interface is returned by
95+
:phpmethod:`MongoDB\\Client::listDatabases()`.
96+
97+
Methods
98+
~~~~~~~
99+
100+
This interface adds no new methods to :php:`Iterator
101+
<manual/en/class.iterator.php>`, but specifies that :php:`current()
102+
<manual/en/iterator.current.php>` will return an instance of
103+
:phpclass:`MongoDB\\Model\\DatabaseInfo`.
104+
105+
----
106+
107+
MongoDB\\Model\\IndexInfo
108+
-------------------------
109+
110+
.. phpclass:: MongoDB\\Model\\IndexInfo
111+
112+
This class models information about an index. Instances of this class are
113+
returned by traversing a :phpclass:`MongoDB\\Model\\IndexInfoIterator`,
114+
which is returned by :phpmethod:`MongoDB\\Collection::listIndexes()`.
115+
116+
This class implements PHP's :php:`ArrayAccess <arrayaccess>` interface. This
117+
provides a mechanism for accessing index fields for which there exists no
118+
helper method. :php`isset() <isset>` may be used to check for the existence
119+
of a field before accessing it with ``[]``.
120+
121+
.. note::
122+
123+
The :phpclass:`MongoDB\\Model\\IndexInfo` class is immutable. Attempting
124+
to modify it via the :php:`ArrayAccess <arrayaccess>` interface will
125+
result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
126+
127+
Methods
128+
~~~~~~~
129+
130+
.. toctree::
131+
:titlesonly:
132+
133+
/reference/method/MongoDBModelIndexInfo-getKey
134+
/reference/method/MongoDBModelIndexInfo-getName
135+
/reference/method/MongoDBModelIndexInfo-getNamespace
136+
/reference/method/MongoDBModelIndexInfo-getVersion
137+
/reference/method/MongoDBModelIndexInfo-isSparse
138+
/reference/method/MongoDBModelIndexInfo-isTtl
139+
/reference/method/MongoDBModelIndexInfo-isUnique
140+
141+
----
142+
143+
MongoDB\\Model\\IndexInfoIterator
144+
---------------------------------
145+
146+
Definition
147+
~~~~~~~~~~
148+
149+
.. phpclass:: MongoDB\\Model\\IndexInfoIterator
150+
151+
This interface extends PHP's :php:`Iterator <manual/en/class.iterator.php>`
152+
interface. An instance of this interface is returned by
153+
:phpmethod:`MongoDB\\Collection::listIndexes()`.
154+
155+
Methods
156+
~~~~~~~
157+
158+
This interface adds no new methods to :php:`Iterator
159+
<manual/en/class.iterator.php>`, but specifies that :php:`current()
160+
<manual/en/iterator.current.php>` will return an instance of
161+
:phpclass:`MongoDB\\Model\\IndexInfo`.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
==============================================
2+
MongoDB\\Model\\CollectionInfo::getCappedMax()
3+
==============================================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
Definition
14+
----------
15+
16+
.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedMax()
17+
18+
Return the document limit for the capped collection. This correlates with the
19+
``max`` option for :phpmethod:`MongoDB\\Database::createCollection()`.
20+
21+
.. code-block:: php
22+
23+
function getCappedMax(): integer|null
24+
25+
Return Values
26+
-------------
27+
28+
The document limit for the capped collection. If the collection is not capped,
29+
``null`` will be returned.
30+
31+
See Also
32+
--------
33+
34+
- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
35+
- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
36+
- :phpmethod:`MongoDB\\Database::createCollection()`
37+
- :manual:`Capped Collections </core/capped-collections>` in the MongoDB manual
38+
- :manual:`listCollections </reference/command/listCollections>` command
39+
reference in the MongoDB manual
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
===============================================
2+
MongoDB\\Model\\CollectionInfo::getCappedSize()
3+
===============================================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
Definition
14+
----------
15+
16+
.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedSize()
17+
18+
Return the size limit for the capped collection in bytes. This correlates
19+
with the ``size`` option for
20+
:phpmethod:`MongoDB\\Database::createCollection()`.
21+
22+
.. code-block:: php
23+
24+
function getCappedSize(): integer|null
25+
26+
Return Values
27+
-------------
28+
29+
The size limit for the capped collection in bytes. If the collection is not
30+
capped, ``null`` will be returned.
31+
32+
See Also
33+
--------
34+
35+
- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
36+
- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
37+
- :phpmethod:`MongoDB\\Database::createCollection()`
38+
- :manual:`Capped Collections </core/capped-collections>` in the MongoDB manual
39+
- :manual:`listCollections </reference/command/listCollections>` command
40+
reference in the MongoDB manual
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
=========================================
2+
MongoDB\\Model\\CollectionInfo::getName()
3+
=========================================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
Definition
14+
----------
15+
16+
.. phpmethod:: MongoDB\\Model\\CollectionInfo::getName()
17+
18+
Return the collection name.
19+
20+
.. code-block:: php
21+
22+
function getName(): string
23+
24+
Return Values
25+
-------------
26+
27+
The collection name.
28+
29+
See Also
30+
--------
31+
32+
- :phpmethod:`MongoDB\\Collection::getCollectionName()`
33+
- :manual:`listCollections </reference/command/listCollections>` command
34+
reference in the MongoDB manual
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
============================================
2+
MongoDB\\Model\\CollectionInfo::getOptions()
3+
============================================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
Definition
14+
----------
15+
16+
.. phpmethod:: MongoDB\\Model\\CollectionInfo::getOptions()
17+
18+
Return the collection options. This correlates with the options for
19+
:phpmethod:`MongoDB\\Database::createCollection()`, but may include
20+
additional fields set by the server.
21+
22+
.. code-block:: php
23+
24+
function getOptions(): array
25+
26+
Return Values
27+
-------------
28+
29+
The collection options.
30+
31+
See Also
32+
--------
33+
34+
- :phpmethod:`MongoDB\\Database::createCollection()`
35+
- :manual:`listCollections </reference/command/listCollections>` command
36+
reference in the MongoDB manual
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
==========================================
2+
MongoDB\\Model\\CollectionInfo::isCapped()
3+
==========================================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
Definition
14+
----------
15+
16+
.. phpmethod:: MongoDB\\Model\\CollectionInfo::isCapped()
17+
18+
Return whether the collection is a :manual:`capped collection
19+
</core/capped-collections>`.
20+
21+
.. code-block:: php
22+
23+
function isCapped(): boolean
24+
25+
Return Values
26+
-------------
27+
28+
Return whether the collection is a capped collection.
29+
30+
See Also
31+
--------
32+
33+
- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
34+
- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
35+
- :manual:`Capped Collections </core/capped-collections>` in the MongoDB manual
36+
- :manual:`listCollections </reference/command/listCollections>` command
37+
reference in the MongoDB manual
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
=======================================
2+
MongoDB\\Model\\DatabaseInfo::getName()
3+
=======================================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
Definition
14+
----------
15+
16+
.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getName()
17+
18+
Return the database name.
19+
20+
.. code-block:: php
21+
22+
function getName(): string
23+
24+
Return Values
25+
-------------
26+
27+
The database name.
28+
29+
See Also
30+
--------
31+
32+
- :phpmethod:`MongoDB\\Database::getDatabaseName()`
33+
- :manual:`listDatabases </reference/command/listDatabases>` command reference
34+
in the MongoDB manual

0 commit comments

Comments
 (0)