protected $parent; | protected $parent; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductCategoryInterface", mappedBy="parent" , fetch="EAGER")) | |||||
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductCategoryInterface", mappedBy="parent", fetch="EAGER") | |||||
* @ORM\OrderBy({"position" = "ASC"}) | * @ORM\OrderBy({"position" = "ASC"}) | ||||
*/ | */ | ||||
protected $childrens; | protected $childrens; |
namespace Lc\CaracoleBundle\Repository\Product; | namespace Lc\CaracoleBundle\Repository\Product; | ||||
use Knp\Component\Pager\PaginatorInterface; | use Knp\Component\Pager\PaginatorInterface; | ||||
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | |||||
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; | use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; | ||||
use Lc\SovBundle\Doctrine\EntityInterface; | use Lc\SovBundle\Doctrine\EntityInterface; | ||||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | use Lc\SovBundle\Repository\AbstractRepositoryQuery; | ||||
return $this->andWhere('productFamilies.status = 1'); | return $this->andWhere('productFamilies.status = 1'); | ||||
} | } | ||||
} | } |
namespace Lc\CaracoleBundle\Repository\Product; | namespace Lc\CaracoleBundle\Repository\Product; | ||||
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | ||||
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | |||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
use Lc\CaracoleBundle\Repository\AbstractStore; | use Lc\CaracoleBundle\Repository\AbstractStore; |
public function getOrganic($user = null, $organizeByParentCategory = true, $query = null) | public function getOrganic($user = null, $organizeByParentCategory = true, $query = null) | ||||
{ | { | ||||
$query = $this->createDefaultQuery($query); | $query = $this->createDefaultQuery($query); | ||||
$query | $query | ||||
->filterIsOrganicLabel() | ->filterIsOrganicLabel() | ||||
->filterIsOnline(); | ->filterIsOnline(); | ||||
$results = $query->find(); | $results = $query->find(); | ||||
return $this->getWithReductions($results, $user, false, $organizeByParentCategory); | return $this->getWithReductions($results, $user, false, $organizeByParentCategory); | ||||
return []; | return []; | ||||
} | } | ||||
// findByTerms | // findByTerms | ||||
public function getByTerms( | public function getByTerms( | ||||
$terms, | $terms, |