Pārlūkot izejas kodu

ProductFamilyRepository : findByTerms

feature/export_comptable
Guillaume pirms 4 gadiem
vecāks
revīzija
b1a1a058aa
1 mainītis faili ar 14 papildinājumiem un 0 dzēšanām
  1. +14
    -0
      ShopBundle/Repository/ProductFamilyRepository.php

+ 14
- 0
ShopBundle/Repository/ProductFamilyRepository.php Parādīt failu

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


}

Notiek ielāde…
Atcelt
Saglabāt