Gather all of the foreign keys for a given type.

        :param type: The type
        :type type: str

        :rtype: BaseCollection

def _gather_keys_by_type(self, type):
        """
        Gather all of the foreign keys for a given type.

        :param type: The type
        :type type: str

        :rtype: BaseCollection
        """
        foreign = self._foreign_key

        keys = (
            BaseCollection.make(list(self._dictionary[type].values()))
            .map(lambda models: getattr(models[0], foreign))
            .unique()
        )

        return keys