return $query->getQuery()->getResult() ; | return $query->getQuery()->getResult() ; | ||||
} | } | ||||
public function findByTerms($terms, $maxResults = false) | |||||
{ | |||||
$query = $this->findByMerchantQuery() ; | |||||
$query->andWhere('e.status = 1'); | |||||
$query->andWhere('e.title LIKE :terms'); | |||||
$query->setParameter(':terms', '%'.$terms.'%') ; | |||||
if($maxResults) { | |||||
$query->setMaxResults($maxResults) ; | |||||
} | |||||
return $query->getQuery()->getResult() ; | |||||
} | |||||
} | } |