Skip to main content

FacetService

FacetService

Contains methods relating to Facet entities.

Signature
class FacetService {
constructor(connection: TransactionalConnection, facetValueService: FacetValueService, translatableSaver: TranslatableSaver, listQueryBuilder: ListQueryBuilder, configService: ConfigService, channelService: ChannelService, customFieldRelationService: CustomFieldRelationService, eventBus: EventBus, translator: TranslatorService, roleService: RoleService)
findAll(ctx: RequestContext, options?: ListQueryOptions<Facet>, relations?: RelationPaths<Facet>) => Promise<PaginatedList<Translated<Facet>>>;
findOne(ctx: RequestContext, facetId: ID, relations?: RelationPaths<Facet>) => Promise<Translated<Facet> | undefined>;
findByCode(facetCode: string, lang: LanguageCode) => Promise<Translated<Facet> | undefined>;
findByCode(ctx: RequestContext, facetCode: string, lang: LanguageCode) => Promise<Translated<Facet> | undefined>;
findByCode(ctxOrFacetCode: RequestContext | string, facetCodeOrLang: string | LanguageCode, lang?: LanguageCode) => Promise<Translated<Facet> | undefined>;
findByFacetValueId(ctx: RequestContext, id: ID) => Promise<Translated<Facet> | undefined>;
create(ctx: RequestContext, input: CreateFacetInput) => Promise<Translated<Facet>>;
update(ctx: RequestContext, input: UpdateFacetInput) => Promise<Translated<Facet>>;
delete(ctx: RequestContext, id: ID, force: boolean = false) => Promise<DeletionResponse>;
assignFacetsToChannel(ctx: RequestContext, input: AssignFacetsToChannelInput) => Promise<Array<Translated<Facet>>>;
removeFacetsFromChannel(ctx: RequestContext, input: RemoveFacetsFromChannelInput) => Promise<Array<ErrorResultUnion<RemoveFacetFromChannelResult, Facet>>>;
}

constructor

method
(connection: TransactionalConnection, facetValueService: FacetValueService, translatableSaver: TranslatableSaver, listQueryBuilder: ListQueryBuilder, configService: ConfigService, channelService: ChannelService, customFieldRelationService: CustomFieldRelationService, eventBus: EventBus, translator: TranslatorService, roleService: RoleService) => FacetService

findAll

method
(ctx: RequestContext, options?: ListQueryOptions<Facet>, relations?: RelationPaths<Facet>) => Promise<PaginatedList<Translated<Facet>>>

findOne

method
(ctx: RequestContext, facetId: ID, relations?: RelationPaths<Facet>) => Promise<Translated<Facet> | undefined>

findByCode

method
(facetCode: string, lang: LanguageCode) => Promise<Translated<Facet> | undefined>

findByCode

method
(ctx: RequestContext, facetCode: string, lang: LanguageCode) => Promise<Translated<Facet> | undefined>

findByCode

method
(ctxOrFacetCode: RequestContext | string, facetCodeOrLang: string | LanguageCode, lang?: LanguageCode) => Promise<Translated<Facet> | undefined>

findByFacetValueId

method
(ctx: RequestContext, id: ID) => Promise<Translated<Facet> | undefined>

Returns the Facet which contains the given FacetValue id.

create

method
(ctx: RequestContext, input: CreateFacetInput) => Promise<Translated<Facet>>

update

method
(ctx: RequestContext, input: UpdateFacetInput) => Promise<Translated<Facet>>

delete

method
(ctx: RequestContext, id: ID, force: boolean = false) => Promise<DeletionResponse>

assignFacetsToChannel

method
(ctx: RequestContext, input: AssignFacetsToChannelInput) => Promise<Array<Translated<Facet>>>

Assigns Facets to the specified Channel

removeFacetsFromChannel

method
(ctx: RequestContext, input: RemoveFacetsFromChannelInput) => Promise<Array<ErrorResultUnion<RemoveFacetFromChannelResult, Facet>>>

Remove Facets from the specified Channel