Skip to main content

EntitySlugService

EntitySlugService

A service that handles slug generation for entities, ensuring uniqueness and handling conflicts by appending numbers.

Signature
class EntitySlugService {
constructor(slugService: SlugService, connection: TransactionalConnection)
generateSlugFromInput(ctx: RequestContext, params: GenerateSlugFromInputParams) => Promise<string>;
}

constructor

method
(slugService: SlugService, connection: TransactionalConnection) => EntitySlugService

generateSlugFromInput

method
(ctx: RequestContext, params: GenerateSlugFromInputParams) => Promise<string>

Generates a slug from input value for an entity, ensuring uniqueness. Automatically detects if the field exists on the base entity or its translation entity.