gridfs = $gridfs; parent::__construct($connection, $ns, $query, $fields); } /** * Return the next file to which this cursor points, and advance the cursor * @link http://php.net/manual/en/mongogridfscursor.getnext.php * @return MongoGridFSFile Returns the next file */ public function getNext() { $file = parent::next(); return new MongoGridFSFile($this->gridfs, $file); } /** * Returns the current file * @link http://php.net/manual/en/mongogridfscursor.current.php * @return MongoGridFSFile The current file */ public function current() { $file = parent::current(); return new MongoGridFSFile($this->gridfs, $file); } /** * Returns the current result's filename * @link http://php.net/manual/en/mongogridfscursor.key.php * @return string The current results filename */ public function key() { $file = parent::current(); return isset($file['filename']) ? $file['filename'] : null; } }