1414use Magento \User \Api \Data \UserInterface ;
1515use Magento \User \Model \Spi \NotificationExceptionInterface ;
1616use Magento \User \Model \Spi \NotificatorInterface ;
17+ use Magento \Framework \App \DeploymentConfig ;
1718
1819/**
1920 * Admin user model
@@ -138,6 +139,11 @@ class User extends AbstractModel implements StorageInterface, UserInterface
138139 */
139140 private $ notificator ;
140141
142+ /**
143+ * @deprecated
144+ */
145+ private $ deploymentConfig ;
146+
141147 /**
142148 * @param \Magento\Framework\Model\Context $context
143149 * @param \Magento\Framework\Registry $registry
@@ -153,6 +159,7 @@ class User extends AbstractModel implements StorageInterface, UserInterface
153159 * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
154160 * @param array $data
155161 * @param Json $serializer
162+ * @param DeploymentConfig|null $deploymentConfig
156163 * @param NotificatorInterface|null $notificator
157164 * @SuppressWarnings(PHPMD.ExcessiveParameterList)
158165 */
@@ -171,6 +178,7 @@ public function __construct(
171178 \Magento \Framework \Data \Collection \AbstractDb $ resourceCollection = null ,
172179 array $ data = [],
173180 Json $ serializer = null ,
181+ DeploymentConfig $ deploymentConfig = null ,
174182 ?NotificatorInterface $ notificator = null
175183 ) {
176184 $ this ->_encryptor = $ encryptor ;
@@ -184,6 +192,8 @@ public function __construct(
184192 $ this ->validationRules = $ validationRules ;
185193 $ this ->serializer = $ serializer
186194 ?: ObjectManager::getInstance ()->get (Json::class);
195+ $ this ->deploymentConfig = $ deploymentConfig
196+ ?: ObjectManager::getInstance ()->get (DeploymentConfig::class);
187197 $ this ->notificator = $ notificator
188198 ?: ObjectManager::getInstance ()->get (NotificatorInterface::class);
189199 }
@@ -217,7 +227,11 @@ public function __sleep()
217227 '_encryptor ' ,
218228 '_transportBuilder ' ,
219229 '_storeManager ' ,
220- '_validatorBeforeSave '
230+ '_validatorBeforeSave ' ,
231+ 'validationRules ' ,
232+ 'serializer ' ,
233+ 'deploymentConfig ' ,
234+ 'notificator '
221235 ]
222236 );
223237 }
@@ -241,6 +255,9 @@ public function __wakeup()
241255 $ this ->_encryptor = $ objectManager ->get (\Magento \Framework \Encryption \EncryptorInterface::class);
242256 $ this ->_transportBuilder = $ objectManager ->get (\Magento \Framework \Mail \Template \TransportBuilder::class);
243257 $ 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);
244261 }
245262
246263 /**
0 commit comments