protected function _filterForeignKeyColumns($fields, $referenceMap) {
        $out = array();
        $foreignKeys = array();
        // create an array of foreign keys...
        foreach ($referenceMap as $relName => $relConfig) {
            $foreignKeys = array_merge($foreignKeys, (array)$relConfig['columns']);
        }
        // ...and return the values that are not in that array.
        return array_diff($fields, $foreignKeys);
    }