public function fetch($class, array $filters = [], array $sortBy = null, $page = 0, $limit = -1, $count = false)
    {
        try {
            return $this->get($class)->find($filters, $sortBy, $page, $limit, $count);
        } catch (FinderException $e) {
            $data = $this->om->getRepository($class)->findBy($filters, null, 0 < $limit ? $limit : null, $page);

            return $count ? count($data) : $data;
        }
    }
public function fetch($class, array $filters = [], array $sortBy = null, $page = 0, $limit = -1, $count = false)
    {
        try {
            return $this->get($class)->find($filters, $sortBy, $page, $limit, $count);
        } catch (FinderException $e) {
            $data = $this->om->getRepository($class)->findBy($filters, null, 0 < $limit ? $limit : null, $page);

            return $count ? count($data) : $data;
        }
    }
public function fetch ( $ class , array $ filters = [ ] , array $ sortBy = null , $ page = 0 , $ limit = - 1 , $ count = false ) { try { return $ this -> get ( $ class ) -> find ( $ filters , $ sortBy , $ page , $ limit , $ count ) ; } catch ( FinderException $ e ) { $ data = $ this -> om -> getRepository ( $ class ) -> findBy ( $ filters , null , 0 < $ limit ? $ limit : null , $ page ) ; return $ count ? count ( $ data ) : $ data ; } }
Builds and fires the query for a given class. There will be no serialization here.

@param string     $class
@param int        $page
@param int        $limit
@param array      $filters
@param array|null $sortBy
@param bool       $count

@return mixed
Builds and fires the query for a given class . There will be no serialization here .