private function isEmpty($table)
    {
        $table = $this->db->quoteName($table);

        /** @noinspection SqlDialectInspection */
        return $this->db->scalar("SELECT COUNT(*) FROM {$table}") == 0;
    }