return the SQL string for set
@param array $values associative array,the key must be the SQL field name
@return string set
11909
private static function updateSet(array $values)
    {
        $ret = "";
        foreach($values as $key=>$value)
            $ret .= $key."=".$value.", ";
        $ret = substr($ret,0,-2);//remove last \", \"
        return $ret;
    }
1227775
private function toStrings($values)
    {
        foreach ($values as &$value) {
            if ($value instanceof \Datetime) {
                $value = $value->format('Y-m-d H:i:s');
            } elseif ($value) {
                $value = (string) $value;
            }
        }

        return $values;
    }
22621
public function setInsertData(array $values)
    {
        $this->dataSet['valuesSet']->add(array_map(function ($value) {
            return $this->completeExpression(new Expr\Parameter($value));
        }, $values));
        
        if ($this->dataSet['columnHashes']->count() == 0) {
            $columns = array_map(function ($columnName) {
                $columnExpression = $this->completeExpression(new Expr\Column($columnName));
                
                return $columnExpression->hashCode();
            }, array_keys($values));
            
            $this->dataSet['columnHashes']->batch($columns);
        }
        
        return $this;
    }
754816
private function doInsert(array $values) {
        $db       = $this->db();
        $mapping  = $this->dao()->getMapping();
        $table    = $mapping['table'];
        $idColumn = $mapping['identity']['column'];
        $id       = null;
        if  (isset($values[$idColumn])) $id = $values[$idColumn];
        else unset($values[$idColumn]);

        // translate column values
        foreach ($values as &$value) {
            $value = $db->escapeLiteral($value);
        }; unset($value);

        // create SQL statement
        $sql = 'insert into '.$table.' ('.join(', ', \array_keys($values)).')
                   values ('.join(', ', $values).')';

        // execute SQL statement
        if ($id) {
            $db->execute($sql);
        }
        else if ($db->supportsInsertReturn()) {
            $id = $db->query($sql.' returning '.$idColumn)->fetchInt();
        }
        else {
            $id = $db->execute($sql)->lastInsertId();
        }
        return $id;
    }
671666
public function escape($values) {
		if (is_array($values)) {
			foreach ($values as $key => $value) {
				$values[$key] = $this->escape($value);
			}
			return $values;
		} else {
			return $this->database->real_escape_string($values);
		}
	}
841752
public function insertGetId(array $values): string
    {
        $stmt = $this->set($values)->prepare();
        $stmt->execute();

        return $this->pdo->lastInsertId();
    }
1126653
public function preparedResults($values)
    {
        $preparedValues = [];

        /* @var $col Col */
        /* @var $field Field */
        foreach ($this->select as $pos => $selectColumn) {
            $col = $selectColumn[0];
            $field = $col->getOutputField();
            $val = ArrayHelper::getValue($values, $pos);
            // first use the inbuilt converters
            try {
                $val = Type::getType(
                    $field->dbType($this->connection)
                )->convertToPHPValue($val, $this->connection->getDatabasePlatform());
            } catch (DBALException $exception) {
            }

            // use the field converters if any were provided by the user.
            $converters = $field->getDbConverters($this->connection);

            if ($converters) {
                foreach ($converters as $converter) {
                    $val = call_user_func($converter, $this->connection, $val, $field);
                }
            }
            $preparedValues[] = $val;
        }

        return $preparedValues;
    }
1367519
public function getWhereIn(string $table, string $field, array $values): array
    {
        try {
            $this->db->beginTransaction();

            $query = "SELECT * FROM $table WHERE $field IN (" . implode(',', $values) . ")";

            /** @var PDOStatement $stmt */
            $stmt = $this->db->prepare($query);
            $stmt->execute();

            $this->db->commit();
            $result = $stmt->fetchAll();

            if ($result === false) {
                throw new NotFoundException($values . ' not found.');
            }

            return $result;
        } catch (PDOException $e) {
            $this->db->rollBack();
            throw new PDOException($e);
        }
    }
1342727
public function values(array $values)
    {
        $this->fieldValues = array();

        $this->fieldsSql   = '?i';
        $this->fieldValues[] = array_keys($values);

        $this->valuesSql   = array();

        foreach ($values as $v) {
            if (is_object($v) and $v instanceof SqlValueInterface) {
                $this->valuesSql[] = $v->getSql();
                $this->fieldValues = array_merge($this->fieldValues, $v->getValues());
            } else {
                $this->valuesSql[]   = '?q';
                $this->fieldValues[] = $v;
            }
        }

        $this->valuesSql = implode(', ', $this->valuesSql);

        return $this;
    }
347175
public function findMany(array $values = [], $columns = [])
    {
        $this->select($columns);

        if (! is_a($this->schema, ActiveDirectory::class)) {
            $query = $this;

            foreach ($values as $value) {
                $query->prepareAnrEquivalentQuery($value);
            }

            return $query->get();
        }

        return $this->findManyBy($this->schema->anr(), $values);
    }
312877
public function inputs(array $values = null): array
    {
        if ($values === null) {
            if ($this->all) {
                return $this->input;
            }

            $values = [];
            if ($this->serverRequest->getMethod() !== 'GET') {
                $values = (array) $this->serverRequest->getParsedBody();
            }

            $values += $this->serverRequest->getQueryParams();
            $this->all = true;
        }

        $this->cache = [];

        return $this->input = $values;
    }
1134972
public function arrayToMultiselect(array $values)
    {
        // First clean the array
        foreach ($values as $k => $v) {
            if (empty($v)) {
                unset($values[$k]);
            }
        }

        // Encode
        $values = (empty($values) ? '^^' : encodeMultienumValue($values));

        // Then return the array
        return $values;
    }
336687
public static function getString(&$var, $values = null)
    {
        if (!is_string($var)) {
            $var = '';
        }
        if ($values !== null) {
            return in_array($var, $values, true) ? $var : $values[0];
        }

        return $var;
    }
630674
public function values(array $values)
    {
        $this->sqlParts['values'] = is_array(current($values)) ? $values : [$values];

        return $this;
    }
848382
protected function getParametersList(array $values)
    {
        $parameters = [];

        foreach ($values as $name => $value) {
            $parameters[$name] = sprintf(
                "$*::%s",
                $this->getStructure()->getTypeFor($name)
            );
        }

        return $parameters;
    }
445906
protected function encodeValues(&$values)
    {
        if (is_array($values)) {
            foreach ($values as &$value) {
                $value = $this->encodeValues($value);
            }
        } elseif (is_float($values)) {
            $values = Common::forceDotAsSeparatorForDecimalPoint($values);
        } elseif (is_string($values)) {
            $values = htmlentities($values, ENT_COMPAT, 'UTF-8');
            $values = str_replace('$', '&#36;', $values);
        }
        return $values;
    }
855507
public function prep($values = null)
    {
        $hash = $this->queryHash();

        $prepOnly = true;

        if (is_array($values)) {

            $prepOnly = false;

        }

        if ($this->oosql_prepParams) {
            $this->oosql_stmt = $this->prepare(trim($this->sql()), $this->oosql_prepParams);
        } else {
            $this->oosql_stmt = $this->prepare(trim($this->sql()));
        }



        if ($prepOnly) {

            return $this->oosql_stmt;

        }

        return $this->execBound($this->oosql_stmt, $values);
    }