Skip to content

Commit f510925

Browse files
ACPT-1194 ... part2
... more Collection resetting...
1 parent 3f7c56c commit f510925

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,18 @@ protected function _construct()
150150
$this->_initTables();
151151
}
152152

153+
/**
154+
* @inheritDoc
155+
*/
156+
public function _resetState(): void
157+
{
158+
parent::_resetState();
159+
$this->_customerId = 0;
160+
$this->_visitorId = 0;
161+
$this->listId = 0;
162+
$this->_comparableAttributes = null;
163+
}
164+
153165
/**
154166
* Set customer filter to collection
155167
*

app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product/Collection.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,21 @@ public function __construct(
183183
}
184184
}
185185

186+
/**
187+
* @inheritDoc
188+
*/
189+
public function _resetState(): void
190+
{
191+
parent::_resetState();
192+
$this->_product = null;
193+
$this->_linkModel = null;
194+
$this->_linkTypeId = null;
195+
$this->_isStrongMode = null;
196+
$this->_hasLinkFilter = false;
197+
$this->productIds = null;
198+
$this->linkField = null;
199+
}
200+
186201
/**
187202
* Declare link model and initialize type attributes join
188203
*

app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,20 @@ public function __construct(
219219
->get(DefaultFilterStrategyApplyChecker::class);
220220
}
221221

222+
/**
223+
* @inheritDoc
224+
*/
225+
public function _resetState(): void
226+
{
227+
parent::_resetState();
228+
$this->queryText = null;
229+
$this->search = null;
230+
$this->searchCriteriaBuilder = null;
231+
$this->searchResult = null;
232+
$this->filterBuilder = null;
233+
$this->searchOrders = null;
234+
}
235+
222236
/**
223237
* Get search.
224238
*

app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ public function __construct(
119119
$this->indexUsageEnforcements = $indexUsageEnforcements;
120120
}
121121

122+
/**
123+
* @inheritDoc
124+
*/
125+
public function _resetState(): void
126+
{
127+
parent::_resetState();
128+
$this->_attributesCollection = null;
129+
$this->_searchQuery = null;
130+
}
131+
122132
/**
123133
* Add search query filter
124134
*

0 commit comments

Comments
 (0)