@@ -32,17 +32,25 @@ class Layout extends \Magento\Backend\Block\Template implements \Magento\Framewo
32
32
*/
33
33
protected $ _productType ;
34
34
35
+ /**
36
+ * @var \Magento\Framework\Serialize\Serializer\Json
37
+ */
38
+ private $ serializer ;
39
+
35
40
/**
36
41
* @param \Magento\Backend\Block\Template\Context $context
37
42
* @param \Magento\Catalog\Model\Product\Type $productType
38
43
* @param array $data
44
+ * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
39
45
*/
40
46
public function __construct (
41
47
\Magento \Backend \Block \Template \Context $ context ,
42
48
\Magento \Catalog \Model \Product \Type $ productType ,
43
- array $ data = []
49
+ array $ data = [],
50
+ \Magento \Framework \Serialize \Serializer \Json $ serializer = null
44
51
) {
45
52
$ this ->_productType = $ productType ;
53
+ $ this ->serializer = $ serializer ;
46
54
parent ::__construct ($ context , $ data );
47
55
}
48
56
@@ -335,17 +343,26 @@ public function getPageGroups()
335
343
$ pageGroups = [];
336
344
if ($ widgetInstance ->getPageGroups ()) {
337
345
foreach ($ widgetInstance ->getPageGroups () as $ pageGroup ) {
338
- $ pageGroups [] = [
339
- 'page_id ' => $ pageGroup ['page_id ' ],
340
- 'group ' => $ pageGroup ['page_group ' ],
341
- 'block ' => $ pageGroup ['block_reference ' ],
342
- 'for_value ' => $ pageGroup ['page_for ' ],
343
- 'layout_handle ' => $ pageGroup ['layout_handle ' ],
344
- $ pageGroup ['page_group ' ] . '_entities ' => $ pageGroup ['entities ' ],
345
- 'template ' => $ pageGroup ['page_template ' ],
346
- ];
346
+ $ pageGroups [] = $ this ->serializer ->serialize ($ this ->getPageGroup ($ pageGroup ));
347
347
}
348
348
}
349
349
return $ pageGroups ;
350
350
}
351
+
352
+ /**
353
+ * @param array $pageGroup
354
+ * @return array
355
+ */
356
+ private function getPageGroup (array $ pageGroup )
357
+ {
358
+ return [
359
+ 'page_id ' => $ pageGroup ['page_id ' ],
360
+ 'group ' => $ pageGroup ['page_group ' ],
361
+ 'block ' => $ pageGroup ['block_reference ' ],
362
+ 'for_value ' => $ pageGroup ['page_for ' ],
363
+ 'layout_handle ' => $ pageGroup ['layout_handle ' ],
364
+ $ pageGroup ['page_group ' ] . '_entities ' => $ pageGroup ['entities ' ],
365
+ 'template ' => $ pageGroup ['page_template ' ],
366
+ ];
367
+ }
351
368
}
0 commit comments