'Wrap a collection, checking for filtering and pagination.
Returns the wrapped collection, which includes:
- Executing any filtering not already carried out
- Truncate to a set limit if necessary
- Adds \'self\' links in every member
- Adds \'next\', \'self\' and \'prev\' links for the whole collection.
:param context: the current context, containing the original url path
and query string
:param refs: the list of members of the collection
:param hints: list hints, containing any relevant filters and limit.
Any filters already satisfied by managers will have been
removed'

@classmethod
def wrap_collection(cls, context, refs, hints=None):

    if (hints is not None):
        refs = cls.filter_by_attributes(refs, hints)
    (list_limited, refs) = cls.limit(refs, hints)
    for ref in refs:
        cls.wrap_member(context, ref)
    container = {cls.collection_name: refs}
    container['links'] = {'next': None, 'self': cls.full_url(context, path=context['path']), 'previous': None}
    if list_limited:
        container['truncated'] = True
    return container
