Skip to content

Commit 885c9e0

Browse files
committed
Catalog fixes
1 parent aa4577d commit 885c9e0

File tree

30 files changed

+265
-30
lines changed

30 files changed

+265
-30
lines changed

app/code/Magento/Catalog/Model/Product/Option/Value.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,5 +462,12 @@ public function setOptionTypeId($optionTypeId)
462462
return $this->setData(self::KEY_OPTION_TYPE_ID, $optionTypeId);
463463
}
464464

465+
/**
466+
* @inheritDoc
467+
*/
468+
public function _resetState(): void
469+
{
470+
// @todo
471+
}
465472
//@codeCoverageIgnoreEnd
466473
}

app/code/Magento/Catalog/Model/Product/Type/Price.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\Catalog\Model\Product;
1111
use Magento\Customer\Api\GroupManagementInterface;
12+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1213
use Magento\Framework\Pricing\PriceCurrencyInterface;
1314
use Magento\Store\Model\Store;
1415
use Magento\Catalog\Api\Data\ProductTierPriceExtensionFactory;
@@ -23,7 +24,7 @@
2324
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2425
* @since 100.0.2
2526
*/
26-
class Price
27+
class Price implements ResetAfterRequestInterface
2728
{
2829
/**
2930
* Product price cache tag
@@ -657,4 +658,14 @@ public function isTierPriceFixed()
657658
{
658659
return true;
659660
}
661+
662+
/**
663+
* @inheritDoc
664+
*/
665+
public function _resetState(): void
666+
{
667+
self::$attributeCache = [];
668+
}
669+
670+
660671
}

app/code/Magento/Catalog/Model/Product/Visibility.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @api
1515
* @since 100.0.2
1616
*/
17-
class Visibility extends \Magento\Framework\DataObject implements OptionSourceInterface
17+
class Visibility implements OptionSourceInterface
1818
{
1919
const VISIBILITY_NOT_VISIBLE = 1;
2020

@@ -49,7 +49,6 @@ public function __construct(
4949
array $data = []
5050
) {
5151
$this->_eavEntityAttribute = $eavEntityAttribute;
52-
parent::__construct($data);
5352
}
5453

5554
/**

app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Builder/Category.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818
use Magento\Framework\Api\Search\BucketInterface;
1919
use Magento\Framework\App\ResourceConnection;
2020
use Magento\Framework\GraphQl\Query\Uid;
21+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
2122

2223
/**
2324
* Category layer builder
2425
*
2526
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2627
*/
27-
class Category implements LayerBuilderInterface
28+
class Category implements LayerBuilderInterface, ResetAfterRequestInterface
2829
{
2930
/**
3031
* @var string
@@ -201,4 +202,17 @@ private function getStoreCategoryIds(int $storeId): array
201202
);
202203
return $collection->getAllIds();
203204
}
205+
206+
/**
207+
* @inheritDoc
208+
*/
209+
public function _resetState(): void
210+
{
211+
self::$bucketMap = [
212+
self::CATEGORY_BUCKET => [
213+
'request_name' => 'category_uid',
214+
'label' => 'Category'
215+
],
216+
];
217+
}
204218
}

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Deferred/Product.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,5 +153,6 @@ public function _resetState(): void
153153
{
154154
$this->productList = [];
155155
$this->productSkus = [];
156+
$this->attributeCodes = [];
156157
}
157158
}

app/code/Magento/CatalogRule/Model/Rule.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
use Magento\Framework\Model\Context;
3232
use Magento\Framework\Model\ResourceModel\AbstractResource;
3333
use Magento\Framework\Model\ResourceModel\Iterator;
34+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
3435
use Magento\Framework\Registry;
3536
use Magento\Framework\Serialize\Serializer\Json;
3637
use Magento\Framework\Stdlib\DateTime;
@@ -50,7 +51,7 @@
5051
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
5152
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
5253
*/
53-
class Rule extends \Magento\Rule\Model\AbstractModel implements RuleInterface, IdentityInterface
54+
class Rule extends \Magento\Rule\Model\AbstractModel implements RuleInterface, IdentityInterface, ResetAfterRequestInterface
5455
{
5556
/**
5657
* Prefix of model events names
@@ -917,4 +918,12 @@ public function clearPriceRulesData(): void
917918
{
918919
self::$_priceRulesData = [];
919920
}
921+
922+
/**
923+
* @inheritDoc
924+
*/
925+
public function _resetState(): void
926+
{
927+
self::$_priceRulesData = [];
928+
}
920929
}

app/code/Magento/Customer/Model/Address/AbstractAddress.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Customer\Model\Data\Address as AddressData;
1515
use Magento\Framework\App\ObjectManager;
1616
use Magento\Framework\Model\AbstractExtensibleModel;
17+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1718

1819
/**
1920
* Address abstract model
@@ -35,7 +36,7 @@
3536
* @api
3637
* @since 100.0.2
3738
*/
38-
class AbstractAddress extends AbstractExtensibleModel implements AddressModelInterface
39+
class AbstractAddress extends AbstractExtensibleModel implements AddressModelInterface, ResetAfterRequestInterface
3940
{
4041
/**
4142
* Possible customer address types
@@ -736,4 +737,13 @@ private function processCustomAttribute(array $attribute): array
736737

737738
return $attribute;
738739
}
740+
741+
/**
742+
* @inheritDoc
743+
*/
744+
public function _resetState(): void
745+
{
746+
self::$_countryModels = [];
747+
self::$_regionModels = [];
748+
}
739749
}

app/code/Magento/Customer/Model/Config/Share.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,14 @@ public function getSharedWebsiteIds($websiteId)
139139
}
140140
return $ids;
141141
}
142+
143+
/**
144+
* @inheritDoc
145+
*/
146+
public function _resetState(): void
147+
{
148+
// @todo
149+
}
150+
151+
142152
}

app/code/Magento/Customer/Model/Customer.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ public function isResetPasswordLinkTokenExpired()
13081308
}
13091309

13101310
$hourDifference = floor(($currentTimestamp - $tokenTimestamp) / (60 * 60));
1311-
1311+
13121312
return $hourDifference >= $expirationPeriod;
13131313
}
13141314

@@ -1403,4 +1403,16 @@ public function getPassword()
14031403
{
14041404
return (string) $this->getData('password');
14051405
}
1406+
1407+
/**
1408+
* @inheritDoc
1409+
*/
1410+
public function _resetState(): void
1411+
{
1412+
// @todo:
1413+
1414+
$this->_data = [];
1415+
}
1416+
1417+
14061418
}

app/code/Magento/Customer/Model/Visitor.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,4 +384,16 @@ public function getOnlineInterval()
384384
);
385385
return $configValue ?: static::DEFAULT_ONLINE_MINUTES_INTERVAL;
386386
}
387+
388+
/**
389+
* @inheritDoc
390+
*/
391+
public function _resetState(): void
392+
{
393+
// @todo
394+
395+
$this->_data = [];
396+
}
397+
398+
387399
}

0 commit comments

Comments
 (0)