Commit 087a53d4 authored by Katherine Walker's avatar Katherine Walker

Merge pull request #523

parents c8e816b8 fc4d261d
...@@ -28,6 +28,28 @@ Return Values ...@@ -28,6 +28,28 @@ Return Values
The document limit for the capped collection. If the collection is not capped, The document limit for the capped collection. If the collection is not capped,
``null`` will be returned. ``null`` will be returned.
Examples
--------
.. code-block:: php
<?php
$info = new CollectionInfo([
'name' => 'foo',
'options' => [
'capped' => true,
'size' => 1048576,
'max' => 100,
]
]);
var_dump($info->getCappedMax());
The output would then resemble::
int(100)
See Also See Also
-------- --------
......
...@@ -29,6 +29,27 @@ Return Values ...@@ -29,6 +29,27 @@ Return Values
The size limit for the capped collection in bytes. If the collection is not The size limit for the capped collection in bytes. If the collection is not
capped, ``null`` will be returned. capped, ``null`` will be returned.
Examples
--------
.. code-block:: php
<?php
$info = new CollectionInfo([
'name' => 'foo',
'options' => [
'capped' => true,
'size' => 1048576,
]
]);
var_dump($info->getCappedSize());
The output would then resemble::
int(1048576)
See Also See Also
-------- --------
......
...@@ -26,6 +26,21 @@ Return Values ...@@ -26,6 +26,21 @@ Return Values
The collection name. The collection name.
Examples
--------
.. code-block:: php
<?php
$info = new CollectionInfo(['name' => 'foo']);
echo $info->getName();
The output would then resemble::
foo
See Also See Also
-------- --------
......
...@@ -28,6 +28,32 @@ Return Values ...@@ -28,6 +28,32 @@ Return Values
The collection options. The collection options.
Examples
--------
.. code-block:: php
<?php
$info = new CollectionInfo([
'name' => 'foo',
'options' => [
'capped' => true,
'size' => 1048576,
]
]);
var_dump($info->getOptions());
The output would then resemble::
array(2) {
["capped"]=>
bool(true)
["size"]=>
int(1048576)
}
See Also See Also
-------- --------
......
...@@ -27,6 +27,27 @@ Return Values ...@@ -27,6 +27,27 @@ Return Values
A boolean indicating whether the collection is a capped collection. A boolean indicating whether the collection is a capped collection.
Examples
--------
.. code-block:: php
<?php
$info = new CollectionInfo([
'name' => 'foo',
'options' => [
'capped' => true,
'size' => 1048576,
]
]);
var_dump($info->isCapped());
The output would then resemble::
bool(true)
See Also See Also
-------- --------
......
...@@ -26,6 +26,21 @@ Return Values ...@@ -26,6 +26,21 @@ Return Values
The database name. The database name.
Examples
--------
.. code-block:: php
<?php
$info = new DatabaseInfo(['name' => 'foo']);
echo $info->getName();
The output would then resemble::
foo
See Also See Also
-------- --------
......
...@@ -26,6 +26,21 @@ Return Values ...@@ -26,6 +26,21 @@ Return Values
The total size of the database file on disk in bytes. The total size of the database file on disk in bytes.
Examples
--------
.. code-block:: php
<?php
$info = new DatabaseInfo(['sizeOnDisk' => 1048576]);
var_dump($info->getSizeOnDisk());
The output would then resemble::
int(1048576)
See Also See Also
-------- --------
......
...@@ -26,6 +26,21 @@ Return Values ...@@ -26,6 +26,21 @@ Return Values
A boolean indicating whether the database has any data. A boolean indicating whether the database has any data.
Examples
--------
.. code-block:: php
<?php
$info = new DatabaseInfo(['empty' => true]);
var_dump($info->isEmpty());
The output would then resemble::
bool(true)
See Also See Also
-------- --------
......
...@@ -28,6 +28,26 @@ Return Values ...@@ -28,6 +28,26 @@ Return Values
The index specification as an associative array. The index specification as an associative array.
Examples
--------
.. code-block:: php
<?php
$info = new IndexInfo([
'key' => ['x' => 1],
]);
var_dump($info->getKey());
The output would then resemble::
array(1) {
["x"]=>
int(1)
}
See Also See Also
-------- --------
......
...@@ -29,6 +29,23 @@ Return Values ...@@ -29,6 +29,23 @@ Return Values
The index name. The index name.
Examples
--------
.. code-block:: php
<?php
$info = new IndexInfo([
'name' => 'x_1',
]);
echo $info->getName();
The output would then resemble::
x_1
See Also See Also
-------- --------
......
...@@ -27,6 +27,23 @@ Return Values ...@@ -27,6 +27,23 @@ Return Values
The index namespace. The index namespace.
Examples
--------
.. code-block:: php
<?php
$info = new IndexInfo([
'ns' => 'foo.bar',
]);
echo $info->getNamespace();
The output would then resemble::
foo.bar
See Also See Also
-------- --------
......
...@@ -26,6 +26,23 @@ Return Values ...@@ -26,6 +26,23 @@ Return Values
The index version. The index version.
Examples
--------
.. code-block:: php
<?php
$info = new IndexInfo([
'v' => 1,
]);
var_dump($info->getVersion());
The output would then resemble::
int(1)
See Also See Also
-------- --------
......
...@@ -28,6 +28,23 @@ Return Values ...@@ -28,6 +28,23 @@ Return Values
A boolean indicating whether the index is a sparse index. A boolean indicating whether the index is a sparse index.
Examples
--------
.. code-block:: php
<?php
$info = new IndexInfo([
'sparse' => true,
]);
var_dump($info->isSparse());
The output would then resemble::
bool(true)
See Also See Also
-------- --------
......
...@@ -28,6 +28,23 @@ Return Values ...@@ -28,6 +28,23 @@ Return Values
A boolean indicating whether the index is a TTL index. A boolean indicating whether the index is a TTL index.
Examples
--------
.. code-block:: php
<?php
$info = new IndexInfo([
'expireAfterSeconds' => 100,
]);
var_dump($info->isTtl());
The output would then resemble::
bool(true)
See Also See Also
-------- --------
......
...@@ -28,6 +28,23 @@ Return Values ...@@ -28,6 +28,23 @@ Return Values
A boolean indicating whether the index is a unique index. A boolean indicating whether the index is a unique index.
Examples
--------
.. code-block:: php
<?php
$info = new IndexInfo([
'unique' => true,
]);
var_dump($info->isUnique());
The output would then resemble::
bool(true)
See Also See Also
-------- --------
......
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