public function findByStatusIdsAndUser($locale, $statusIds, UserInterface $user, $limit = null)
    {
        try {
            $qb = $this->getOrderQuery($locale)
                ->andWhere('o.creator = :user')
                ->setParameter('user', $user)
                ->andWhere('status.id IN (:statusId)')
                ->setParameter('statusId', $statusIds)
                ->orderBy('o.created', 'DESC')
                ->setMaxResults($limit);

            return $qb->getQuery()->getResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
public function findByStatusIdsAndUser($locale, $statusIds, UserInterface $user, $limit = null)
    {
        try {
            $qb = $this->getOrderQuery($locale)
                ->andWhere('o.creator = :user')
                ->setParameter('user', $user)
                ->andWhere('status.id IN (:statusId)')
                ->setParameter('statusId', $statusIds)
                ->orderBy('o.created', 'DESC')
                ->setMaxResults($limit);

            return $qb->getQuery()->getResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
public function findByStatusIdsAndUser ( $ locale , $ statusIds , UserInterface $ user , $ limit = null ) { try { $ qb = $ this -> getOrderQuery ( $ locale ) -> andWhere ( 'o.creator = :user' ) -> setParameter ( 'user' , $ user ) -> andWhere ( 'status.id IN (:statusId)' ) -> setParameter ( 'statusId' , $ statusIds ) -> orderBy ( 'o.created' , 'DESC' ) -> setMaxResults ( $ limit ) ; return $ qb -> getQuery ( ) -> getResult ( ) ; } catch ( NoResultException $ exc ) { return null ; } }
Finds orders by statusIds and user.

@param string $locale
@param array $statusIds
@param UserInterface $user
@param int|null $limit

@return array|null
Finds orders by statusIds and user .