-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b303a3
commit 8ad6263
Showing
12 changed files
with
268 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,15 +15,21 @@ | |
namespace Gally\SyliusPlugin\Indexer; | ||
|
||
use Gally\SyliusPlugin\Service\IndexOperation; | ||
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\ResourceRepositoryTrait; | ||
use Sylius\Bundle\TaxonomyBundle\Doctrine\ORM\TaxonRepository; | ||
use Sylius\Component\Core\Model\ChannelInterface; | ||
use Sylius\Component\Core\Model\TaxonInterface; | ||
use Sylius\Component\Locale\Model\LocaleInterface; | ||
use Sylius\Component\Resource\Repository\RepositoryInterface; | ||
use Sylius\Component\Taxonomy\Model\TaxonTranslationInterface; | ||
use Sylius\Component\Taxonomy\Repository\TaxonRepositoryInterface; | ||
|
||
/** | ||
* Class CategoryIndexer | ||
* | ||
* @package Gally | ||
* @author Stephan Hochdörfer <[email protected]>, Gally Team <[email protected]> | ||
* @copyright 2022-present Smile | ||
* @license Open Software License v. 3.0 (OSL-3.0) | ||
*/ | ||
class CategoryIndexer extends AbstractIndexer | ||
{ | ||
private TaxonRepositoryInterface $taxonRepository; | ||
|
@@ -100,11 +106,11 @@ private function formatTaxon(TaxonInterface $taxon, TaxonTranslationInterface $t | |
{ | ||
$parentId = ''; | ||
if (null !== $taxon->getParent()) { | ||
$parentId = (string) $taxon->getParent()->getCode(); | ||
$parentId = str_replace('/', '_', (string) $taxon->getParent()->getCode()); | ||
} | ||
|
||
return [ | ||
'id' => (string) $taxon->getCode(), | ||
'id' => str_replace('/', '_', (string) $taxon->getCode()), | ||
'parentId' => $parentId, | ||
'level' => $taxon->getLevel() + 1, | ||
'path' => $this->pathCache[$taxon->getCode()], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,14 @@ | |
use Sylius\Component\Product\Model\ProductOptionValueInterface; | ||
use Sylius\Component\Resource\Repository\RepositoryInterface; | ||
|
||
/** | ||
* Class ProductIndexer | ||
* | ||
* @package Gally | ||
* @author Stephan Hochdörfer <[email protected]>, Gally Team <[email protected]> | ||
* @copyright 2022-present Smile | ||
* @license Open Software License v. 3.0 (OSL-3.0) | ||
*/ | ||
class ProductIndexer extends AbstractIndexer | ||
{ | ||
public function __construct( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.