private function getTotal(string $table): int
    {
        $config = $this->reader->getEntityConfig($table);
        $limit = (int)$config['limit'];
        if ($config['action'] === 'insert') {
            return empty($limit) ? 100 : $limit;
        }

        $rows = $this->dbUtils->countResults($table);
        if (empty($limit)) {
            return $rows;
        }

        if (!empty($limit) && $limit > $rows) {
            return $rows;
        }

        return $limit;
    }