28 private $tableMaintainer;
35 private $dimensionFactory;
40 private $dimensionModeConfiguration;
45 private $websiteDimensionProvider;
61 $this->updateIndex = $updateIndex;
62 $this->tableMaintainer = $tableMaintainer;
63 $this->dimensionFactory = $dimensionFactory;
64 $this->dimensionModeConfiguration = $dimensionModeConfiguration;
65 $this->websiteDimensionProvider = $websiteDimensionProvider;
83 $isGroupNew = !
$group->getId();
86 foreach ($this->getAffectedDimensions((
string)
$group->getId()) as $dimensions) {
87 $this->tableMaintainer->createTablesForDimensions($dimensions);
90 $this->updateIndex->update(
$group, $isGroupNew);
106 foreach ($this->getAffectedDimensions(
$groupId) as $dimensions) {
107 $this->tableMaintainer->dropTablesForDimensions($dimensions);
119 private function getAffectedDimensions(
string $groupId): array
121 $currentDimensions = $this->dimensionModeConfiguration->getDimensionConfiguration();
123 if (!in_array(CustomerGroupDimensionProvider::DIMENSION_NAME, $currentDimensions,
true)) {
126 $customerGroupDimension = $this->dimensionFactory->create(
127 CustomerGroupDimensionProvider::DIMENSION_NAME,
132 if (in_array(WebsiteDimensionProvider::DIMENSION_NAME, $currentDimensions,
true)) {
133 foreach ($this->websiteDimensionProvider as $websiteDimension) {
135 $customerGroupDimension,
140 $dimensions[] = [$customerGroupDimension];
__construct(UpdateIndexInterface $updateIndex, TableMaintainer $tableMaintainer, DimensionFactory $dimensionFactory, DimensionModeConfiguration $dimensionModeConfiguration, WebsiteDimensionProvider $websiteDimensionProvider)
afterDeleteById(GroupRepositoryInterface $subject, bool $result, string $groupId)
aroundSave(GroupRepositoryInterface $subject, \Closure $proceed, GroupInterface $group)