public function add(): int
    {
        if (empty($this->logdate) || empty($this->logstamp)) {

            $time = time();

            if (empty($this->logdate)) {
                $this->logdate = date('Y-m-d H:i:s', $time);
            }

            if (empty($this->logstamp)) {
                $this->logstamp = $time;
            }
        }

        if (empty($this->client)) {
            $this->client = $_SERVER['HTTP_USER_AGENT'];
        }

        if (empty($this->ip)) {
            $this->ip = $_SERVER['REMOTE_ADDR'];
        }

        if (empty($this->url)) {
            $this->url = $_SERVER['REQUEST_URI'];
        }

        $this->db->qb([
            'table' => 'core_bans',
            'data' => [
                'text' => $this->text,
                'logdate' => $this->logdate,
                'logstamp' => $this->logstamp,
                'client' => $this->client,
                'ip' => $this->ip,
                'url' => $this->url,
                'id_user' => $this->id_user,
                'code' => $this->code
            ]
        ], true);

        return $this->db->lastInsertId();
    }