Skip to content

Commit a60967f

Browse files
committed
solved static test
1 parent d3c7fec commit a60967f

File tree

1 file changed

+15
-4
lines changed
  • app/code/Magento/ConfigurableProduct/Plugin/Catalog/Model/Product/Attribute/Backend/TierPrice

1 file changed

+15
-4
lines changed

app/code/Magento/ConfigurableProduct/Plugin/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandlerPlugin.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
<?php
2+
/**
3+
* Copyright © 2024 Your Company Name
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
27

38
namespace Magento\ConfigurableProduct\Plugin\Catalog\Model\Product\Attribute\Backend\TierPrice;
49

510
use Magento\Catalog\Api\ProductAttributeRepositoryInterface;
611
use Magento\Catalog\Model\Product\Attribute\Backend\TierPrice\UpdateHandler;
712
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
813

14+
/**
15+
* Plugin for handling tier prices during product attribute backend update.
16+
*/
917
class UpdateHandlerPlugin
1018
{
1119
/**
@@ -14,15 +22,18 @@ class UpdateHandlerPlugin
1422
private $attributeRepository;
1523

1624
/**
25+
* UpdateHandlerPlugin constructor.
26+
*
1727
* @param ProductAttributeRepositoryInterface $attributeRepository
1828
*/
19-
public function __construct(
20-
ProductAttributeRepositoryInterface $attributeRepository
21-
) {
29+
public function __construct(ProductAttributeRepositoryInterface $attributeRepository)
30+
{
2231
$this->attributeRepository = $attributeRepository;
2332
}
2433

2534
/**
35+
* Before execute plugin.
36+
*
2637
* @param UpdateHandler $subject
2738
* @param mixed $entity
2839
* @param array $arguments
@@ -32,7 +43,7 @@ public function beforeExecute(UpdateHandler $subject, $entity, $arguments = [])
3243
{
3344
$attribute = $this->attributeRepository->get('tier_price');
3445
$origPrices = $entity->getOrigData($attribute->getName());
35-
46+
3647
if ($entity->getTypeId() === Configurable::TYPE_CODE && $origPrices !== null) {
3748
$entity->setData($attribute->getName(), []);
3849
}

0 commit comments

Comments
 (0)