src/Repository.php
public function findAll($projections = [], $sorts = [], $options = [])
    {
        $options = $this->createOption($projections, $sorts, $options);

        $result = $this->collection->find([], $options);

        if (!isset($options['iterator']) || $options['iterator'] === false) {
            $objects = [];
            foreach ($result as $datas) {
                if (null != ($object = $this->createObject($datas, $options))) {
                    $objects[] = $object;
                }
            }
            return $objects;
        } else {
            $iteratorClass = $options['iterator'];
            $iterator = $iteratorClass === true ? new DocumentIterator($result, $this->modelName, $this) : new $iteratorClass($result, $this->modelName, $this);
            if (isset($options['readOnly']) && $options['readOnly'] == true) {
                $iterator->readOnly();
            }
            return $iterator;
        }
    }
public function findAll($projections = [], $sorts = [], $options = [])
    {
        $options = $this->createOption($projections, $sorts, $options);

        $result = $this->collection->find([], $options);

        if (!isset($options['iterator']) || $options['iterator'] === false) {
            $objects = [];
            foreach ($result as $datas) {
                if (null != ($object = $this->createObject($datas, $options))) {
                    $objects[] = $object;
                }
            }
            return $objects;
        } else {
            $iteratorClass = $options['iterator'];
            $iterator = $iteratorClass === true ? new DocumentIterator($result, $this->modelName, $this) : new $iteratorClass($result, $this->modelName, $this);
            if (isset($options['readOnly']) && $options['readOnly'] == true) {
                $iterator->readOnly();
            }
            return $iterator;
        }
    }
public function findAll ( $ projections = [ ] , $ sorts = [ ] , $ options = [ ] ) { $ options = $ this -> createOption ( $ projections , $ sorts , $ options ) ; $ result = $ this -> collection -> find ( [ ] , $ options ) ; if ( ! isset ( $ options [ 'iterator' ] ) || $ options [ 'iterator' ] === false ) { $ objects = [ ] ; foreach ( $ result as $ datas ) { if ( null != ( $ object = $ this -> createObject ( $ datas , $ options ) ) ) { $ objects [ ] = $ object ; } } return $ objects ; } else { $ iteratorClass = $ options [ 'iterator' ] ; $ iterator = $ iteratorClass === true ? new DocumentIterator ( $ result , $ this -> modelName , $ this ) : new $ iteratorClass ( $ result , $ this -> modelName , $ this ) ; if ( isset ( $ options [ 'readOnly' ] ) && $ options [ 'readOnly' ] == true ) { $ iterator -> readOnly ( ) ; } return $ iterator ; } }
Find all document of the 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              Sort options
@param   array                   $options            Options for the query
@return  array                                       Array containing all the document of the collection
Find all document of the collection