Think\Db\Builder::parseData PHP Метод

parseData() защищенный Метод

数据分析
protected parseData ( array $data, array $options ) : array
$data array 数据
$options array 查询参数
Результат array
    protected function parseData($data, $options)
    {
        if (empty($data)) {
            return [];
        }
        // 获取绑定信息
        $bind = $this->query->getFieldsBind($options);
        if ('*' == $options['field']) {
            $fields = array_keys($bind);
        } else {
            $fields = $options['field'];
        }
        $result = [];
        foreach ($data as $key => $val) {
            $item = $this->parseKey($key, $options);
            if (!in_array($key, $fields, true)) {
                if ($options['strict']) {
                    throw new Exception('fields not exists:[' . $key . ']');
                }
            } elseif (isset($val[0]) && 'exp' == $val[0]) {
                $result[$item] = $val[1];
            } elseif (is_null($val)) {
                $result[$item] = 'NULL';
            } elseif (is_scalar($val)) {
                // 过滤非标量数据
                if ($this->query->isBind(substr($val, 1))) {
                    $result[$item] = $val;
                } else {
                    $this->query->bind($key, $val, isset($bind[$key]) ? $bind[$key] : PDO::PARAM_STR);
                    $result[$item] = ':' . $key;
                }
            }
        }
        return $result;
    }