Fab 4 years ago
parent
commit
7278dbed73
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      ShopBundle/Repository/ProductFamilyRepository.php

+ 11
- 0
ShopBundle/Repository/ProductFamilyRepository.php View File

@@ -60,4 +60,15 @@ class ProductFamilyRepository extends BaseRepository implements DefaultRepositor

return $categoriesArray;
}

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

Loading…
Cancel
Save