gridfs = $gridfs; parent::__construct($connection, $ns, $query, $fields); } /** * 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 ($file !== null) ? new MongoGridFSFile($this->gridfs, $file) : null; } /** * 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 = $this->current(); return ($file !== null) ? (string) $file->file['_id'] : null; } }