src/Model/Traits/RecursiveRestoreTrait.php
public function restore(array $data, array $fields)
    {
        foreach ($fields as $field => $type) {
            if (!isset($data[$field])) {
                continue;
            }

            $property = AccessorUtil::property($field);
            $value = $data[$field];

            $value = $this->getPropertyValueForRestore($type, $value, $field);

            $this->{$property} = $value;
        }
    }
public function restore(array $data, array $fields)
    {
        foreach ($fields as $field => $type) {
            if (!isset($data[$field])) {
                continue;
            }

            $property = AccessorUtil::property($field);
            $value = $data[$field];

            $value = $this->getPropertyValueForRestore($type, $value, $field);

            $this->{$property} = $value;
        }
    }
@param array $data
@param array $fields

@return void
@throws \UnexpectedValueException