yii\mongodb\file\Download::getChunkIterator PHP Method

getChunkIterator() public method

Returns iterator for the file chunks cursor.
public getChunkIterator ( boolean $refresh = false ) : Iterator
$refresh boolean whether to recreate iterator, if it is already exist.
return Iterator chuck cursor iterator.
    public function getChunkIterator($refresh = false)
    {
        if ($refresh || $this->_chunkIterator === null) {
            $this->_chunkIterator = new \IteratorIterator($this->getChunkCursor($refresh));
            $this->_chunkIterator->rewind();
        }
        return $this->_chunkIterator;
    }