@@ -64,24 +64,35 @@ class ReadHandler implements AttributeInterface
64
64
* @param AppResource $appResource
65
65
* @param ScopeResolver $scopeResolver
66
66
* @param AttributeCache $attributeCache
67
- * @param LoggerInterface $logger
68
67
*/
69
68
public function __construct (
70
69
AttributeRepository $ attributeRepository ,
71
70
MetadataPool $ metadataPool ,
72
71
SearchCriteriaBuilder $ searchCriteriaBuilder ,
73
72
AppResource $ appResource ,
74
73
ScopeResolver $ scopeResolver ,
75
- AttributeCache $ attributeCache ,
76
- LoggerInterface $ logger
74
+ AttributeCache $ attributeCache
77
75
) {
78
76
$ this ->attributeRepository = $ attributeRepository ;
79
77
$ this ->metadataPool = $ metadataPool ;
80
78
$ this ->searchCriteriaBuilder = $ searchCriteriaBuilder ;
81
79
$ this ->appResource = $ appResource ;
82
80
$ this ->scopeResolver = $ scopeResolver ;
83
81
$ this ->attributeCache = $ attributeCache ;
84
- $ this ->logger = $ logger ;
82
+ }
83
+
84
+ /**
85
+ * Get Logger
86
+ *
87
+ * @return LoggerInterface
88
+ * @deprecated
89
+ */
90
+ private function getLogger ()
91
+ {
92
+ if ($ this ->logger === null ) {
93
+ $ this ->logger = \Magento \Framework \App \ObjectManager::getInstance ()->create (LoggerInterface::class);
94
+ }
95
+ return $ this ->logger ;
85
96
}
86
97
87
98
/**
@@ -174,7 +185,7 @@ public function execute($entityType, $entityData, $arguments = [])
174
185
if (isset ($ attributesMap [$ attributeValue ['attribute_id ' ]])) {
175
186
$ entityData [$ attributesMap [$ attributeValue ['attribute_id ' ]]] = $ attributeValue ['value ' ];
176
187
} else {
177
- $ this ->logger ->warning (
188
+ $ this ->getLogger () ->warning (
178
189
"Attempt to load value of nonexistent EAV attribute ' {$ attributeValue ['attribute_id ' ]}'
179
190
for entity type ' $ entityType'. "
180
191
);
0 commit comments