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();
    }