public function done()
    {
        if ($this->is_done) {
            throw new RuntimeException('This batch insert is already done');
        }

        $this->flush();
        $this->is_done = true;

        return $this->total;
    }