CollectionInfoCommandIterator.php 851 Bytes
Newer Older
1 2 3 4 5 6
<?php

namespace MongoDB\Model;

use IteratorIterator;

7 8 9 10 11 12 13 14 15 16 17
/**
 * 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/
 */
18 19 20 21 22
class CollectionInfoCommandIterator extends IteratorIterator implements CollectionInfoIterator
{
    /**
     * Return the current element as a CollectionInfo instance.
     *
23 24
     * @see CollectionInfoIterator::current()
     * @see http://php.net/iterator.current
25 26 27 28 29 30 31
     * @return CollectionInfo
     */
    public function current()
    {
        return new CollectionInfo(parent::current());
    }
}