interface BatchSlugDriverInterface

Optional companion to SlugDriverInterface for drivers that can resolve many slugs in a single query. Consumers that resolve slugs in bulk (e.g. the tag filter) should prefer this when the active driver implements it, and fall back to looping SlugDriverInterface::fromSlug() otherwise.

Methods

Collection
fromSlugs(array $slugs, User $actor)

Resolve a set of slugs to their models, respecting actor visibility.

Details

Collection fromSlugs(array $slugs, User $actor)

Resolve a set of slugs to their models, respecting actor visibility.

Slugs that do not resolve (unknown, or not visible to the actor) are simply absent from the returned collection.

Parameters

array $slugs
User $actor

Return Value

Collection models keyed by the slug they resolved from