public function getVisibilityAffectingFieldsByTable($table)
    {
        if (isset($this->visibilityAffectingFields[$table])) {
            return $this->visibilityAffectingFields[$table];
        }

        // we always want to get the uid and pid although they do not affect visibility
        $fields = ['uid', 'pid'];
        if (isset($this->tca[$table]['ctrl']['enablecolumns'])) {
            $fields = array_merge($fields, $this->tca[$table]['ctrl']['enablecolumns']);
        }

        if (isset($this->tca[$table]['ctrl']['delete'])) {
            $fields[] = $this->tca[$table]['ctrl']['delete'];
        }

        if ($table === 'pages') {
            $fields[] = 'no_search';
            $fields[] = 'doktype';
        }

        $this->visibilityAffectingFields[$table] = implode(', ', $fields);

        return $this->visibilityAffectingFields[$table];
    }