src/Phlexible/Bundle/MessageBundle/Entity/Repository/MessageRepository.php
public function findByCriteria(Criteria $criteria, $order = null, $limit = null, $offset = 0)
    {
        $qb = $this->createCriteriaQueryBuilder($criteria, 'm');

        if ($order) {
            foreach ($order as $field => $dir) {
                $qb->orderBy("m.$field", $dir);
            }
        }
        if ($limit) {
            $qb->setMaxResults($limit);
        }
        if ($offset) {
            $qb->setFirstResult($offset);
        }

        return $qb->getQuery()->getResult();
    }
public function findByCriteria(Criteria $criteria, $order = null, $limit = null, $offset = 0)
    {
        $qb = $this->createCriteriaQueryBuilder($criteria, 'm');

        if ($order) {
            foreach ($order as $field => $dir) {
                $qb->orderBy("m.$field", $dir);
            }
        }
        if ($limit) {
            $qb->setMaxResults($limit);
        }
        if ($offset) {
            $qb->setFirstResult($offset);
        }

        return $qb->getQuery()->getResult();
    }
public function findByCriteria ( Criteria $ criteria , $ order = null , $ limit = null , $ offset = 0 ) { $ qb = $ this -> createCriteriaQueryBuilder ( $ criteria , 'm' ) ; if ( $ order ) { foreach ( $ order as $ field => $ dir ) { $ qb -> orderBy ( "m.$field" , $ dir ) ; } } if ( $ limit ) { $ qb -> setMaxResults ( $ limit ) ; } if ( $ offset ) { $ qb -> setFirstResult ( $ offset ) ; } return $ qb -> getQuery ( ) -> getResult ( ) ; }
Find messages by criteria.

@param Criteria $criteria
@param array    $order
@param int      $limit
@param int      $offset

@return Filter
Find messages by criteria .