Browse Source

Adaptations ProductCategoryRepository et ProductFamilyRepository

feature/module_traiteur_v1
Guillaume 3 years ago
parent
commit
5d3be5c1ec
2 changed files with 16 additions and 0 deletions
  1. +7
    -0
      ShopBundle/Repository/ProductCategoryRepository.php
  2. +9
    -0
      ShopBundle/Repository/ProductFamilyRepository.php

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

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


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

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

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

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


public function getProductFamiliesBySection($section)
{
$query = $this->findByMerchantQuery() ;
$query = $this->joinRelations($query) ;


$query->andWhere(':section MEMBER OF e.sections')
->setParameter('section', $section) ;

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




} }

Loading…
Cancel
Save