/** * @param \Propel\Runtime\ActiveQuery\ModelCriteria $expandableQuery * @param bool $excludeDirectParent * @param bool $excludeRoot * * @return \Propel\Runtime\ActiveQuery\ModelCriteria */ public function expandQuery(ModelCriteria $expandableQuery, $excludeDirectParent = true, $excludeRoot = true) { $expandableQuery->addJoin(SpyTouchTableMap::COL_ITEM_ID, SpyProductCategoryTableMap::COL_FK_PRODUCT_ABSTRACT, Criteria::LEFT_JOIN); $expandableQuery->addJoin(SpyProductCategoryTableMap::COL_FK_CATEGORY_NODE, SpyCategoryNodeTableMap::COL_ID_CATEGORY_NODE, Criteria::INNER_JOIN); $expandableQuery->addJoin(SpyCategoryNodeTableMap::COL_FK_CATEGORY, SpyCategoryAttributeTableMap::COL_FK_CATEGORY, Criteria::INNER_JOIN); $expandableQuery = $this->categoryQueryContainer->joinCategoryQueryWithUrls($expandableQuery); $expandableQuery = $this->categoryQueryContainer->selectCategoryAttributeColumns($expandableQuery); $expandableQuery = $this->categoryQueryContainer->joinCategoryQueryWithChildrenCategories($expandableQuery); $expandableQuery = $this->categoryQueryContainer->joinLocalizedRelatedCategoryQueryWithAttributes($expandableQuery, 'categoryChildren', 'child'); $expandableQuery = $this->categoryQueryContainer->joinRelatedCategoryQueryWithUrls($expandableQuery, 'categoryChildren', 'child'); $expandableQuery = $this->categoryQueryContainer->joinCategoryQueryWithParentCategories($expandableQuery, $excludeDirectParent, $excludeRoot); $expandableQuery = $this->categoryQueryContainer->joinLocalizedRelatedCategoryQueryWithAttributes($expandableQuery, 'categoryParents', 'parent'); $expandableQuery = $this->categoryQueryContainer->joinRelatedCategoryQueryWithUrls($expandableQuery, 'categoryParents', 'parent'); $expandableQuery->withColumn('GROUP_CONCAT(DISTINCT spy_category_node.id_category_node)', 'node_id'); $expandableQuery->withColumn(SpyCategoryNodeTableMap::COL_FK_CATEGORY, 'category_id'); $expandableQuery->orderBy('depth', Criteria::DESC); $expandableQuery->orderBy('descendant_id', Criteria::DESC); $expandableQuery->groupBy('abstract_sku'); return $expandableQuery; }