Entity/Repositories/SentEmailRepository.php
public function search($searchParams = array())
    {
        $queryBuilder = $this->createQueryBuilder('e');

        if (!empty($searchParams)) {
            $searchAttributes = array(
                'recipients',
                'template',
                'sent',
                'variables',
                'token',
            );

            foreach ($searchAttributes as $attribute) {
                if (empty($searchParams[$attribute])) {
                    continue;
                }

                $attributeValue = $searchParams[$attribute];

                $queryBuilder->andWhere('e.'.$attribute.' LIKE :'.$attribute)
                    ->setParameter($attribute, '%'.$attributeValue.'%');
            }
        }

        return $queryBuilder->getQuery();
    }
public function search($searchParams = array())
    {
        $queryBuilder = $this->createQueryBuilder('e');

        if (!empty($searchParams)) {
            $searchAttributes = array(
                'recipients',
                'template',
                'sent',
                'variables',
                'token',
            );

            foreach ($searchAttributes as $attribute) {
                if (empty($searchParams[$attribute])) {
                    continue;
                }

                $attributeValue = $searchParams[$attribute];

                $queryBuilder->andWhere('e.'.$attribute.' LIKE :'.$attribute)
                    ->setParameter($attribute, '%'.$attributeValue.'%');
            }
        }

        return $queryBuilder->getQuery();
    }
public function search ( $ searchParams = array ( ) ) { $ queryBuilder = $ this -> createQueryBuilder ( 'e' ) ; if ( ! empty ( $ searchParams ) ) { $ searchAttributes = array ( 'recipients' , 'template' , 'sent' , 'variables' , 'token' , ) ; foreach ( $ searchAttributes as $ attribute ) { if ( empty ( $ searchParams [ $ attribute ] ) ) { continue ; } $ attributeValue = $ searchParams [ $ attribute ] ; $ queryBuilder -> andWhere ( 'e.' . $ attribute . ' LIKE :' . $ attribute ) -> setParameter ( $ attribute , '%' . $ attributeValue . '%' ) ; } } return $ queryBuilder -> getQuery ( ) ; }
Search SentEmails by search params.

@param $searchParams

@return Query
Search SentEmails by search params .