@@ -19,6 +19,8 @@ class CreateHandler extends AbstractHandler
19
19
const ADDITIONAL_STORE_DATA_KEY = 'additional_store_data ' ;
20
20
21
21
/**
22
+ * Execute before Plugin
23
+ *
22
24
* @param \Magento\Catalog\Model\Product\Gallery\CreateHandler $mediaGalleryCreateHandler
23
25
* @param \Magento\Catalog\Model\Product $product
24
26
* @param array $arguments
@@ -44,6 +46,8 @@ public function beforeExecute(
44
46
}
45
47
46
48
/**
49
+ * Execute plugin
50
+ *
47
51
* @param \Magento\Catalog\Model\Product\Gallery\CreateHandler $mediaGalleryCreateHandler
48
52
* @param \Magento\Catalog\Model\Product $product
49
53
* @return \Magento\Catalog\Model\Product
@@ -73,6 +77,8 @@ public function afterExecute(
73
77
}
74
78
75
79
/**
80
+ * Saves video data
81
+ *
76
82
* @param array $videoDataCollection
77
83
* @param int $storeId
78
84
* @return void
@@ -86,6 +92,8 @@ protected function saveVideoData(array $videoDataCollection, $storeId)
86
92
}
87
93
88
94
/**
95
+ * Saves additioanal video data
96
+ *
89
97
* @param array $videoDataCollection
90
98
* @return void
91
99
*/
@@ -102,6 +110,8 @@ protected function saveAdditionalStoreData(array $videoDataCollection)
102
110
}
103
111
104
112
/**
113
+ * Saves video data
114
+ *
105
115
* @param array $item
106
116
* @return void
107
117
*/
@@ -114,6 +124,8 @@ protected function saveVideoValuesItem(array $item)
114
124
}
115
125
116
126
/**
127
+ * Excludes current store data
128
+ *
117
129
* @param array $mediaCollection
118
130
* @param int $currentStoreId
119
131
* @return array
@@ -129,6 +141,8 @@ function ($item) use ($currentStoreId) {
129
141
}
130
142
131
143
/**
144
+ * Prepare video data for saving
145
+ *
132
146
* @param array $rowData
133
147
* @return array
134
148
*/
@@ -146,6 +160,8 @@ protected function prepareVideoRowDataForSave(array $rowData)
146
160
}
147
161
148
162
/**
163
+ * Loads video data
164
+ *
149
165
* @param array $mediaCollection
150
166
* @param int $excludedStore
151
167
* @return array
@@ -168,6 +184,8 @@ protected function loadStoreViewVideoData(array $mediaCollection, $excludedStore
168
184
}
169
185
170
186
/**
187
+ * Collect video data
188
+ *
171
189
* @param array $mediaCollection
172
190
* @return array
173
191
*/
@@ -185,6 +203,8 @@ protected function collectVideoData(array $mediaCollection)
185
203
}
186
204
187
205
/**
206
+ * Extract video data
207
+ *
188
208
* @param array $rowData
189
209
* @return array
190
210
*/
@@ -197,6 +217,8 @@ protected function extractVideoDataFromRowData(array $rowData)
197
217
}
198
218
199
219
/**
220
+ * Collect items for additional data adding
221
+ *
200
222
* @param array $mediaCollection
201
223
* @return array
202
224
*/
@@ -212,6 +234,8 @@ protected function collectVideoEntriesIdsToAdditionalLoad(array $mediaCollection
212
234
}
213
235
214
236
/**
237
+ * Add additional data
238
+ *
215
239
* @param array $mediaCollection
216
240
* @param array $data
217
241
* @return array
@@ -232,6 +256,8 @@ protected function addAdditionalStoreData(array $mediaCollection, array $data):
232
256
}
233
257
234
258
/**
259
+ * Creates additional video data
260
+ *
235
261
* @param array $storeData
236
262
* @param int $valueId
237
263
* @return array
@@ -250,6 +276,8 @@ protected function createAdditionalStoreDataCollection(array $storeData, $valueI
250
276
}
251
277
252
278
/**
279
+ * Collect new videos
280
+ *
253
281
* @param array $mediaCollection
254
282
* @return array
255
283
*/
@@ -265,6 +293,8 @@ private function collectNewVideos(array $mediaCollection): array
265
293
}
266
294
267
295
/**
296
+ * Checks if gallery item is video
297
+ *
268
298
* @param array $item
269
299
* @return bool
270
300
*/
@@ -276,6 +306,8 @@ private function isVideoItem(array $item): bool
276
306
}
277
307
278
308
/**
309
+ * Checks if video is new
310
+ *
279
311
* @param array $item
280
312
* @return bool
281
313
*/
@@ -287,6 +319,7 @@ private function isNewVideo(array $item): bool
287
319
}
288
320
289
321
/**
322
+ * Mark all videos as new
290
323
*
291
324
* @param int $entityId
292
325
* @param array $mediaCollection
0 commit comments