src/GridFS/Repository.php
public function findAll($projections = array(), $sorts = array(), $options = array())
    {
        $options = $this->createOption($projections, $sorts, $options);
        if (!isset($options['iterator']) || $options['iterator'] === false) {
            $objects = parent::findAll($projections, $sorts, $options);
            foreach ($objects as $object) {
                if ($this->getStreamProjection($projections)) {
                    $data["stream"] = $this->bucket->openDownloadStream($object->getId());
                }
                $this->hydrator->hydrate($object, $data, true);
            }
            return $objects;
        } else {
            if (!is_string($options['iterator'])) {
                $options['iterator'] = GridFSDocumentIterator::class;
            }
            return parent::findAll($projections, $sorts, $options);
        }
    }
public function findAll($projections = array(), $sorts = array(), $options = array())
    {
        $options = $this->createOption($projections, $sorts, $options);
        if (!isset($options['iterator']) || $options['iterator'] === false) {
            $objects = parent::findAll($projections, $sorts, $options);
            foreach ($objects as $object) {
                if ($this->getStreamProjection($projections)) {
                    $data["stream"] = $this->bucket->openDownloadStream($object->getId());
                }
                $this->hydrator->hydrate($object, $data, true);
            }
            return $objects;
        } else {
            if (!is_string($options['iterator'])) {
                $options['iterator'] = GridFSDocumentIterator::class;
            }
            return parent::findAll($projections, $sorts, $options);
        }
    }
public function findAll ( $ projections = array ( ) , $ sorts = array ( ) , $ options = array ( ) ) { $ options = $ this -> createOption ( $ projections , $ sorts , $ options ) ; if ( ! isset ( $ options [ 'iterator' ] ) || $ options [ 'iterator' ] === false ) { $ objects = parent :: findAll ( $ projections , $ sorts , $ options ) ; foreach ( $ objects as $ object ) { if ( $ this -> getStreamProjection ( $ projections ) ) { $ data [ "stream" ] = $ this -> bucket -> openDownloadStream ( $ object -> getId ( ) ) ; } $ this -> hydrator -> hydrate ( $ object , $ data , true ) ; } return $ objects ; } else { if ( ! is_string ( $ options [ 'iterator' ] ) ) { $ options [ 'iterator' ] = GridFSDocumentIterator :: class ; } return parent :: findAll ( $ projections , $ sorts , $ options ) ; } }
Get all documents of collection

Options :
*   readOnly : boolean - When false, flush will not update object
*   iterator : boolean|string - Return DocumentIterator if true (or specified class if is string)
@see MongoDB\Operation\Find::__construct for more option

@param   array                   $projections        Projection of the query
@param   array                   $sorts              Sorts specification
@param   array                   $options            Options for the query
@param array $options
@return void
Get all documents of collection