Browse Source

ProductFamilyRepository : findByTerms

feature/export_comptable
Guillaume 4 years ago
parent
commit
b1a1a058aa
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      ShopBundle/Repository/ProductFamilyRepository.php

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

@@ -79,5 +79,19 @@ class ProductFamilyRepository extends BaseRepository implements DefaultRepositor
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() ;
}


}

Loading…
Cancel
Save