public function insert($columns, $duplicateKey = null, $params = [])
    {
        if (is_string($duplicateKey) && 'ignore' == strtolower($duplicateKey)) {
            $q = "INSERT IGNORE INTO {$this->table} ";
        } else {
            $q = "INSERT INTO {$this->table} ";
        }
        $cols = array();
        $vals = array();
        $this->params = $params;
        foreach ($columns as $name => $value) {
            $cols[] = '`' . $name . '`';
            $vals[] = ":$name";
            $this->params[":$name"] = $value;
        }
        $q .= "(" . implode(", ", $cols) . ") VALUES (" . implode(", ", $vals) . ")";
        if (is_array($duplicateKey) && count($duplicateKey)) {
            $q .= " ON DUPLICATE KEY UPDATE ";
            $updates = [];
            foreach ($duplicateKey as $column => $value) {
                $updates[] = "`$column` = :dp_{$column}";
                $this->params[':dp_' . $column] = $value;
            }
            $q .= implode(", ", $updates);
        } elseif ($duplicateKey && is_string($duplicateKey) && ('ignore' != strtolower($duplicateKey))) {
            $q .= " ON DUPLICATE KEY UPDATE " . $duplicateKey;
        }
        if ($this->connection->execQuery($q, $this->params)) {
            return $this->connection->lastInsertId() ? $this->connection->lastInsertId() : true;
        } else {
            return false;
        }

    }