<?php
 namespace ModStart\Field; class KeyValueList extends AbstractField { protected $value = []; public function unserializeValue($value, AbstractField $field) { $value = @json_decode($value, true); if (empty($value)) { $value = []; } return $value; } public function serializeValue($value, $model) { return json_encode($value); } public function prepareInput($value, $model) { $value = @json_decode($value, true); if (empty($value)) { $value = []; } return $value; } }