Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,28 @@ Return Values
The document limit for the capped collection. If the collection is not capped,
``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
--------

Expand Down
21 changes: 21 additions & 0 deletions docs/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ Return Values
The size limit for the capped collection in bytes. If the collection is not
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
--------

Expand Down
15 changes: 15 additions & 0 deletions docs/reference/method/MongoDBModelCollectionInfo-getName.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ Return Values

The collection name.

Examples
--------

.. code-block:: php

<?php

$info = new CollectionInfo(['name' => 'foo']);

echo $info->getName();

The output would then resemble::

foo

See Also
--------

Expand Down
26 changes: 26 additions & 0 deletions docs/reference/method/MongoDBModelCollectionInfo-getOptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,32 @@ Return Values

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
--------

Expand Down
21 changes: 21 additions & 0 deletions docs/reference/method/MongoDBModelCollectionInfo-isCapped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,27 @@ Return Values

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
--------

Expand Down
15 changes: 15 additions & 0 deletions docs/reference/method/MongoDBModelDatabaseInfo-getName.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ Return Values

The database name.

Examples
--------

.. code-block:: php

<?php

$info = new DatabaseInfo(['name' => 'foo']);

echo $info->getName();

The output would then resemble::

foo

See Also
--------

Expand Down
15 changes: 15 additions & 0 deletions docs/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ Return Values

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
--------

Expand Down
15 changes: 15 additions & 0 deletions docs/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ Return Values

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
--------

Expand Down
20 changes: 20 additions & 0 deletions docs/reference/method/MongoDBModelIndexInfo-getKey.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ Return Values

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
--------

Expand Down
17 changes: 17 additions & 0 deletions docs/reference/method/MongoDBModelIndexInfo-getName.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ Return Values

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
--------

Expand Down
17 changes: 17 additions & 0 deletions docs/reference/method/MongoDBModelIndexInfo-getNamespace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ Return Values

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
--------

Expand Down
17 changes: 17 additions & 0 deletions docs/reference/method/MongoDBModelIndexInfo-getVersion.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ Return Values

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
--------

Expand Down
17 changes: 17 additions & 0 deletions docs/reference/method/MongoDBModelIndexInfo-isSparse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ Return Values

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
--------

Expand Down
17 changes: 17 additions & 0 deletions docs/reference/method/MongoDBModelIndexInfo-isTtl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ Return Values

A boolean indicating whether the index is a TTL index.

Examples
--------

.. code-block:: php

<?php

$info = new IndexInfo([
'expireAfterSeconds' => 100,
]);

var_dump($info->isTtl());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really use isTtl and not isTTL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we do!


The output would then resemble::

bool(true)

See Also
--------

Expand Down
17 changes: 17 additions & 0 deletions docs/reference/method/MongoDBModelIndexInfo-isUnique.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ Return Values

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
--------

Expand Down