Skip to content

Commit 96f1d71

Browse files
authored
Merge pull request #223 from magento-performance/application-server
ACPT-1360: _resetState methods cause same state as initially constructed
2 parents e566ad2 + 1a70570 commit 96f1d71

File tree

1 file changed

+18
-1
lines changed
  • app/code/Magento/PageBuilder/Model/ResourceModel/Template/Grid

1 file changed

+18
-1
lines changed

app/code/Magento/PageBuilder/Model/ResourceModel/Template/Grid/Collection.php

+18-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ class Collection extends TemplateCollection implements SearchResultInterface
3131
*/
3232
private $aggregations;
3333

34+
/** @var string */
35+
private $model;
36+
37+
/** @var string */
38+
private $resourceModel;
39+
3440
/**
3541
* @param EntityFactoryInterface $entityFactory
3642
* @param LoggerInterface $logger
@@ -58,6 +64,8 @@ public function __construct(
5864
$connection = null,
5965
AbstractDb $resource = null
6066
) {
67+
$this->resourceModel = $resourceModel;
68+
$this->model = $model;
6169
parent::__construct(
6270
$entityFactory,
6371
$logger,
@@ -68,10 +76,19 @@ public function __construct(
6876
);
6977
$this->_eventPrefix = $eventPrefix;
7078
$this->_eventObject = $eventObject;
71-
$this->_init($model, $resourceModel);
79+
$this->_init($this->model, $this->resourceModel);
7280
$this->setMainTable($mainTable);
7381
}
7482

83+
/**
84+
* @inheritDoc
85+
*/
86+
public function _resetState(): void
87+
{
88+
parent::_resetState();
89+
$this->_init($this->model, $this->resourceModel);
90+
}
91+
7592
/**
7693
* Get aggregations
7794
*

0 commit comments

Comments
 (0)