Phalcon\Db\Adapter\MongoDB\GridFS\ReadableStream::__construct PHP Method

__construct() public method

Constructs a readable GridFS stream.
public __construct ( CollectionWrapper $collectionWrapper, stdClass $file )
$collectionWrapper CollectionWrapper GridFS collection wrapper
$file stdClass GridFS file document
    public function __construct(CollectionWrapper $collectionWrapper, stdClass $file)
    {
        $this->file = $file;
        $this->chunksIterator = $collectionWrapper->getChunksIteratorByFilesId($this->file->_id);
        $this->numChunks = $file->length >= 0 ? ceil($file->length / $file->chunkSize) : 0;
        $this->initEmptyBuffer();
    }