Skip to content

Commit 0f6071c

Browse files
ACPT-1327
No longer resetting _idFieldName or _map. Also adding reset for Eav/Model/ResourceModel/Form/Attribute/Collection
1 parent be0c9fa commit 0f6071c

File tree

7 files changed

+12
-56
lines changed

7 files changed

+12
-56
lines changed

app/code/Magento/Cms/Model/ResourceModel/Block/Collection.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,6 @@ protected function _construct()
5454
$this->_map['fields']['block_id'] = 'main_table.block_id';
5555
}
5656

57-
/**
58-
* @inheritDoc
59-
*/
60-
public function _resetState(): void
61-
{
62-
parent::_resetState();
63-
$this->_map['fields']['store'] = 'store_table.store_id';
64-
$this->_map['fields']['block_id'] = 'main_table.block_id';
65-
}
66-
6757
/**
6858
* Returns pairs block_id - title
6959
*

app/code/Magento/Cms/Model/ResourceModel/Page/Collection.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,6 @@ protected function _construct()
4747
$this->_map['fields']['store'] = 'store_table.store_id';
4848
}
4949

50-
/**
51-
* @inheritDoc
52-
*/
53-
public function _resetState(): void
54-
{
55-
parent::_resetState();
56-
$this->_map['fields']['page_id'] = 'main_table.page_id';
57-
$this->_map['fields']['store'] = 'store_table.store_id';
58-
}
59-
6050
/**
6151
* Set first store flag
6252
*

app/code/Magento/Eav/Model/ResourceModel/Form/Attribute/Collection.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ protected function _construct()
9696
}
9797
}
9898

99+
/**
100+
* @inheritDoc
101+
*/
102+
public function _resetState(): void
103+
{
104+
parent::_resetState();
105+
$this->_store = null;
106+
$this->_entityType = null;
107+
}
108+
99109
/**
100110
* Get EAV website table
101111
*

app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ protected function _construct()
6767
$this->_init(\Magento\Newsletter\Model\Queue::class, \Magento\Newsletter\Model\ResourceModel\Queue::class);
6868
}
6969

70-
/**
71-
* @inheritDoc
72-
*/
73-
public function _resetState(): void
74-
{
75-
parent::_resetState();
76-
$this->_map['fields']['queue_id'] = 'main_table.queue_id';
77-
}
78-
7970
/**
8071
* Joins templates information
8172
*

app/code/Magento/Newsletter/Model/ResourceModel/Subscriber/Collection.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,6 @@ protected function _construct()
106106
$this->_map['fields']['store_id'] = 'main_table.store_id';
107107
}
108108

109-
/**
110-
* @inheritDoc
111-
*/
112-
public function _resetState(): void
113-
{
114-
parent::_resetState();
115-
$this->_map['fields']['type'] = $this->getResource()->getConnection()->getCheckSql(
116-
'main_table.customer_id = 0',
117-
1,
118-
2
119-
);
120-
$this->_map['fields']['website_id'] = 'store.website_id';
121-
$this->_map['fields']['group_id'] = 'store.group_id';
122-
$this->_map['fields']['store_id'] = 'main_table.store_id';
123-
}
124-
125109
/**
126110
* Set loading mode subscribers by queue
127111
*

app/code/Magento/SalesRule/Model/ResourceModel/Rule/Collection.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,6 @@ protected function _construct()
9696
$this->_map['fields']['rule_id'] = 'main_table.rule_id';
9797
}
9898

99-
/**
100-
* @inheritDoc
101-
*/
102-
public function _resetState(): void
103-
{
104-
parent::_resetState();
105-
$this->_map['fields']['rule_id'] = 'main_table.rule_id';
106-
}
107-
10899
/**
109100
* Map data for associated entities
110101
*

lib/internal/Magento/Framework/Data/Collection/AbstractDb.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ public function _resetState(): void
127127
{
128128
parent::_resetState();
129129
$this->setConnection($this->_conn);
130-
$this->_idFieldName = null;
130+
// Note: not resetting _idFieldName because some subclasses define it class property
131131
$this->_bindParams = [];
132132
$this->_data = null;
133-
$this->_map = null;
133+
// Note: not resetting _map because some subclasses define it class property but not _construct method.
134134
$this->_fetchStmt = null;
135135
$this->_isOrdersRendered = false;
136136
$this->extensionAttributesJoinProcessor = null;

0 commit comments

Comments
 (0)