public function findOrdersByStatusAndAccount($locale, $status, AccountInterface $account)
    {
        try {
            $qb = $this->getOrderQuery($locale)
                ->leftJoin('o.creator', 'creator')
                ->leftJoin('creator.contact', 'contact')
                ->leftJoin('contact.accountContacts', 'accountContact', 'WITH', 'accountContact.main = true')
                ->leftJoin('accountContact.account', 'account')
                ->andWhere('status.id = :statusId')
                ->andWhere('account = :account')
                ->setParameter('account', $account)
                ->setParameter('statusId', $status);

            return $qb->getQuery()->getResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
public function findOrdersByStatusAndAccount($locale, $status, AccountInterface $account)
    {
        try {
            $qb = $this->getOrderQuery($locale)
                ->leftJoin('o.creator', 'creator')
                ->leftJoin('creator.contact', 'contact')
                ->leftJoin('contact.accountContacts', 'accountContact', 'WITH', 'accountContact.main = true')
                ->leftJoin('accountContact.account', 'account')
                ->andWhere('status.id = :statusId')
                ->andWhere('account = :account')
                ->setParameter('account', $account)
                ->setParameter('statusId', $status);

            return $qb->getQuery()->getResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
public function findOrdersByStatusAndAccount ( $ locale , $ status , AccountInterface $ account ) { try { $ qb = $ this -> getOrderQuery ( $ locale ) -> leftJoin ( 'o.creator' , 'creator' ) -> leftJoin ( 'creator.contact' , 'contact' ) -> leftJoin ( 'contact.accountContacts' , 'accountContact' , 'WITH' , 'accountContact.main = true' ) -> leftJoin ( 'accountContact.account' , 'account' ) -> andWhere ( 'status.id = :statusId' ) -> andWhere ( 'account = :account' ) -> setParameter ( 'account' , $ account ) -> setParameter ( 'statusId' , $ status ) ; return $ qb -> getQuery ( ) -> getResult ( ) ; } catch ( NoResultException $ exc ) { return null ; } }
Find all orders of an account with a specific status.

@param string $locale
@param int $status
@param AccountInterface $account

@return OrderInterface[]|null
Find all orders of an account with a specific status .