/**
  * Loads a list of documents by a list of field criteria.
  * 
  * @param array $criteria
  * @return array
  */
 public function loadAll(array $criteria = array())
 {
     $criteria = $this->prepareQuery($criteria);
     $cursor = $this->collection->find($criteria);
     $mongoCursor = $cursor->getMongoCursor();
     return new Cursor($mongoCursor, $this->uow, $this->class);
 }
Пример #2
0
 /**
  * Loads a list of documents by a list of field criteria.
  *
  * @param array $criteria
  * @return array
  */
 public function loadAll(array $criteria = array(), array $orderBy = null, $limit = null, $offset = null)
 {
     $criteria = $this->prepareQuery($criteria);
     $cursor = $this->collection->find($criteria);
     if (null !== $orderBy) {
         $cursor->sort($orderBy);
     }
     if (null !== $limit) {
         $cursor->limit($limit);
     }
     if (null !== $offset) {
         $cursor->skip($offset);
     }
     return $this->wrapCursor($cursor);
 }
Пример #3
0
 /**
  * Loads a list of documents by a list of field criteria.
  *
  * @param array $criteria
  * @return array
  */
 public function loadAll(array $criteria = array())
 {
     $criteria = $this->prepareQuery($criteria);
     $cursor = $this->collection->find($criteria);
     return $this->wrapCursor($cursor);
 }
 /**
  * Loads a list of documents by a list of field criteria.
  *
  * @param array $criteria
  * @return array
  */
 public function loadAll(array $query = array(), array $select = array())
 {
     $cursor = $this->collection->find($query, $select);
     return new MongoCursor($this->dm, $this->dm->getHydrator(), $this->class, $cursor);
 }