Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SerializedDataConverter.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Sales\Setup;
8 
11 
16 {
25  public function convert($value)
26  {
27  if ($this->isValidJsonValue($value)) {
28  return $value;
29  }
30  $valueUnserialized = $this->unserializeValue($value);
31  if (isset($valueUnserialized['options'])) {
32  foreach ($valueUnserialized['options'] as $key => $option) {
33  if ($option['option_type'] === 'file') {
34  $valueUnserialized['options'][$key]['option_value'] = parent::convert($option['option_value']);
35  }
36  }
37  }
38  if (isset($valueUnserialized['bundle_selection_attributes'])) {
39  $valueUnserialized['bundle_selection_attributes'] = parent::convert(
40  $valueUnserialized['bundle_selection_attributes']
41  );
42  }
43  return $this->encodeJson($valueUnserialized);
44  }
45 }
$value
Definition: gender.phtml:16