Contao\Database\Statement::escapeParams PHP Method

escapeParams() protected method

Escape the values and serialize objects and arrays
protected escapeParams ( array $arrValues ) : array
$arrValues array The values array
return array The array with the escaped values
    protected function escapeParams($arrValues)
    {
        foreach ($arrValues as $k => $v) {
            switch (gettype($v)) {
                case 'string':
                    $arrValues[$k] = $this->resConnection->quote($v);
                    break;
                case 'boolean':
                    $arrValues[$k] = $v === true ? 1 : 0;
                    break;
                case 'object':
                    $arrValues[$k] = $this->resConnection->quote(serialize($v));
                    break;
                case 'array':
                    $arrValues[$k] = $this->resConnection->quote(serialize($v));
                    break;
                default:
                    $arrValues[$k] = $v === null ? 'NULL' : $v;
                    break;
            }
        }
        return $arrValues;
    }