-
Notifications
You must be signed in to change notification settings - Fork 0
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
7ffe489
commit a8e6e53
Showing
11 changed files
with
199 additions
and
133 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?php | ||
/** | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade Gally to newer versions in the future. | ||
* | ||
* @package Gally | ||
* @author Gally Team <elasticsuite@smile.fr> | ||
* @copyright 2024-present Smile | ||
* @license Open Software License v. 3.0 (OSL-3.0) | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Gally\OroPlugin\Decorator; | ||
|
||
use Gally\OroPlugin\Search\SearchRegistry; | ||
use Oro\Bundle\FilterBundle\Datasource\FilterDatasourceAdapterInterface; | ||
use Oro\Bundle\FilterBundle\Filter\FilterInterface; | ||
use Oro\Bundle\SearchBundle\Datagrid\Filter\SearchNumberFilter; | ||
|
||
class SavePriceFilterUnit implements FilterInterface | ||
{ | ||
public function __construct( | ||
private SearchNumberFilter $decorated, | ||
private SearchRegistry $searchRegistry, | ||
) { | ||
} | ||
|
||
public function init($name, array $params) | ||
{ | ||
$this->decorated->init($name, $params); | ||
} | ||
|
||
public function getName() | ||
{ | ||
return $this->decorated->getName(); | ||
} | ||
|
||
public function getForm() | ||
{ | ||
return $this->decorated->getForm(); | ||
} | ||
|
||
public function getMetadata() | ||
{ | ||
return $this->decorated->getMetadata(); | ||
} | ||
|
||
public function resolveOptions() | ||
{ | ||
return $this->decorated->resolveOptions(); | ||
} | ||
|
||
public function apply(FilterDatasourceAdapterInterface $ds, $data): void | ||
{ | ||
if (isset($data['unit'])) { | ||
$this->searchRegistry->setPriceFilterUnit($data['unit']); | ||
} | ||
$this->decorated->apply($ds, $data); | ||
} | ||
|
||
public function prepareData(array $data): array | ||
{ | ||
return $this->decorated->prepareData($data); | ||
} | ||
|
||
public function setFilterState($state): void | ||
{ | ||
$this->decorated->setFilterState($state); | ||
} | ||
|
||
public function getFilterState() | ||
{ | ||
return $this->decorated->getFilterState(); | ||
} | ||
|
||
public function reset(): void | ||
{ | ||
$this->decorated->reset(); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,8 +1,31 @@ | ||
<?php | ||
/** | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade Gally to newer versions in the future. | ||
* | ||
* @package Gally | ||
* @author Gally Team <elasticsuite@smile.fr> | ||
* @copyright 2024-present Smile | ||
* @license Open Software License v. 3.0 (OSL-3.0) | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Gally\OroPlugin\Resolver; | ||
|
||
class PriceGroupResolver | ||
{ | ||
|
||
public function getGroupId(bool $isCPLUsed, int $priceListId, string $currency, ?string $unit): string | ||
{ | ||
return implode( | ||
'_', | ||
array_filter([ | ||
$isCPLUsed ? 'cpl' : 'pl', | ||
$priceListId, | ||
$currency, | ||
$unit, | ||
]) | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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.