Page MenuHomeDevCentral

No OneTemporary

diff --git a/includes/collection/MongoDBCollectionIterator.php b/includes/collection/MongoDBCollectionIterator.php
index abbbd26..6ce5913 100644
--- a/includes/collection/MongoDBCollectionIterator.php
+++ b/includes/collection/MongoDBCollectionIterator.php
@@ -1,86 +1,89 @@
<?php
/**
* _, __, _, _ __, _ _, _, _
* / \ |_) (_ | | \ | /_\ |\ |
* \ / |_) , ) | |_/ | | | | \|
* ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
*
* MongoDB collection iterator class
*
* @package ObsidianWorkspaces
* @subpackage Collection
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @filesource
*/
/**
* Iterator for MongoDBCollection::getAll()
*/
class MongoDBCollectionIterator implements Iterator {
/**
* @var MongoCursor The MongoDB cursor
*/
private $cursor;
/**
* @var MongoDBCollection The collection attached to the current iterator instance
*/
private $collection;
/**
* Initializes a new instance of the MongoDBCollectionIterator object
*
* @param MongoDBCollection $collection The collection to itrate
* @param MongoCursor $cursor The cursor to the results [optional]
*/
public function __construct (MongoDBCollection $collection, MongoCursor $cursor = null) {
$this->collection = $collection;
if ($cursor === null) {
$this->cursor = $collection->mongoCollection->find();
} else {
$this->cursor = $cursor;
}
}
/**
* Returns a collection document from the current result
+ *
* @return CollectionDocument the current result's document
*/
public function current () {
return $this->collection->getDocumentFromArray(
$this->cursor->current()
);
}
/**
* Returns the key of the current element
+ *
* @return string the current result's _id
*/
public function key () {
return $this->cursor->key();
}
/**
* Moves forward to next element
*/
public function next () {
$this->cursor->next();
}
/**
* Rewinds the iterator to the first element
*/
public function rewind () {
$this->cursor->rewind();
}
/**
* Checks if current position is valid
+ *
* @return boolean true if the current position is valid ; otherwise, false
*/
public function valid () {
return $this->cursor->valid();
}
}

File Metadata

Mime Type
text/x-diff
Expires
Thu, Sep 18, 09:16 (11 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2990307
Default Alt Text
(2 KB)

Event Timeline