public static function parseModel($parameters, $model)
    {
        if (is_object($parameters)) {
            $parameters = (array)$parameters;
        }

        $required_fields = [];
        foreach ($model as $key => $value) {
            if (in_array('required', $value, true) === true
                || in_array('required', $value, true) == true) {
                $required_fields[] = $key;
            }
        }

        Request::requireParameters($parameters, $required_fields);
        \Phramework\Validate\Validate::model($parameters, $model);

        $keys_values = [];
        foreach ($model as $key => $value) {
            if (isset($parameters[$key])) {
                if (in_array('nullable', $value) && $parameters[$key] == '0') {
                    $keys_values[$key] = null;
                    continue;
                }
                //Set value as null
                if (in_array('nullable', $value) && !$parameters[$key]) {
                    $keys_values[$key] = null;
                    continue;
                }
                /*
                if ($value['type'] == 'select' && !$parameters[$key]) {
                    $keys_values[$key] = NULL;
                } else {*/
                    $keys_values[$key] = $parameters[$key];
                /*}*/
            } elseif (($value['type'] == 'boolean' || in_array('boolean', $value))
                && (!isset($parameters[$key]) || !$parameters[$key])) {
                $keys_values[$key] = false;
            }
        }

        return $keys_values;
    }