14
14
use Magento \User \Api \Data \UserInterface ;
15
15
use Magento \User \Model \Spi \NotificationExceptionInterface ;
16
16
use Magento \User \Model \Spi \NotificatorInterface ;
17
+ use Magento \Framework \App \DeploymentConfig ;
17
18
18
19
/**
19
20
* Admin user model
@@ -138,6 +139,11 @@ class User extends AbstractModel implements StorageInterface, UserInterface
138
139
*/
139
140
private $ notificator ;
140
141
142
+ /**
143
+ * @deprecated
144
+ */
145
+ private $ deploymentConfig ;
146
+
141
147
/**
142
148
* @param \Magento\Framework\Model\Context $context
143
149
* @param \Magento\Framework\Registry $registry
@@ -153,6 +159,7 @@ class User extends AbstractModel implements StorageInterface, UserInterface
153
159
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
154
160
* @param array $data
155
161
* @param Json $serializer
162
+ * @param DeploymentConfig|null $deploymentConfig
156
163
* @param NotificatorInterface|null $notificator
157
164
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
158
165
*/
@@ -171,6 +178,7 @@ public function __construct(
171
178
\Magento \Framework \Data \Collection \AbstractDb $ resourceCollection = null ,
172
179
array $ data = [],
173
180
Json $ serializer = null ,
181
+ DeploymentConfig $ deploymentConfig = null ,
174
182
?NotificatorInterface $ notificator = null
175
183
) {
176
184
$ this ->_encryptor = $ encryptor ;
@@ -184,6 +192,8 @@ public function __construct(
184
192
$ this ->validationRules = $ validationRules ;
185
193
$ this ->serializer = $ serializer
186
194
?: ObjectManager::getInstance ()->get (Json::class);
195
+ $ this ->deploymentConfig = $ deploymentConfig
196
+ ?: ObjectManager::getInstance ()->get (DeploymentConfig::class);
187
197
$ this ->notificator = $ notificator
188
198
?: ObjectManager::getInstance ()->get (NotificatorInterface::class);
189
199
}
@@ -217,7 +227,11 @@ public function __sleep()
217
227
'_encryptor ' ,
218
228
'_transportBuilder ' ,
219
229
'_storeManager ' ,
220
- '_validatorBeforeSave '
230
+ '_validatorBeforeSave ' ,
231
+ 'validationRules ' ,
232
+ 'serializer ' ,
233
+ 'deploymentConfig ' ,
234
+ 'notificator '
221
235
]
222
236
);
223
237
}
@@ -241,6 +255,9 @@ public function __wakeup()
241
255
$ this ->_encryptor = $ objectManager ->get (\Magento \Framework \Encryption \EncryptorInterface::class);
242
256
$ this ->_transportBuilder = $ objectManager ->get (\Magento \Framework \Mail \Template \TransportBuilder::class);
243
257
$ this ->_storeManager = $ objectManager ->get (\Magento \Store \Model \StoreManagerInterface::class);
258
+ $ this ->validationRules = $ objectManager ->get (UserValidationRules::class);
259
+ $ this ->deploymentConfig = $ objectManager ->get (DeploymentConfig::class);
260
+ $ this ->notificator = $ objectManager ->get (NotificatorInterface::class);
244
261
}
245
262
246
263
/**
0 commit comments