public function loadAll(array $criteria = [], $limit = null)
    {
        $qb = $this->dm->createQueryBuilder($this->class->name)->addCriteria($criteria);

        return $qb->getQuery()->limit($limit)->execute();
    }
public function loadAll(array $criteria = [], $limit = null)
    {
        $qb = $this->dm->createQueryBuilder($this->class->name)->addCriteria($criteria);

        return $qb->getQuery()->limit($limit)->execute();
    }
public function loadAll ( array $ criteria = [ ] , $ limit = null ) { $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) -> addCriteria ( $ criteria ) ; return $ qb -> getQuery ( ) -> limit ( $ limit ) -> execute ( ) ; }
Load all documents from a table, optionally limited by the provided criteria.

@param array    $criteria Query criteria.
@param int|null $limit    Limit the number of documents returned.

@return Iterator
Load all documents from a table optionally limited by the provided criteria .