Browse Source

findOneBySlug

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

+ 7
- 0
ShopBundle/Repository/ProductCategoryRepository.php View File

->orderBy('e.position', 'ASC'); ->orderBy('e.position', 'ASC');
} }


public function findOneBySlug($slug)
{
$query = $this->findByMerchantQuery() ;
$query->andWhere('e.slug = :slug')->setParameter('slug',$slug) ;
return $query->getQuery()->getOneOrNullResult() ;
}

public function findAllParents($withOffline = false) public function findAllParents($withOffline = false)
{ {
$query = $this->findByMerchantQuery() $query = $this->findByMerchantQuery()

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

return $query->getQuery()->getResult() ; return $query->getQuery()->getResult() ;
} }


public function findOneBySlug($slug)
{
$query = $this->findByMerchantQuery() ;
$query->andWhere('e.slug = :slug')->setParameter('slug',$slug) ;
return $query->getQuery()->getOneOrNullResult() ;
}

public function getProductFamiliesByCategory($category){ public function getProductFamiliesByCategory($category){
$query = $this->findByMerchantQuery() ; $query = $this->findByMerchantQuery() ;
$query = $this->joinRelations($query) ; $query = $this->joinRelations($query) ;

Loading…
Cancel
Save