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)
  findAll(ctx: RequestContext, options?: ListQueryOptions<Facet>) => Promise<PaginatedList<Translated<Facet>>>;
  findOne(ctx: RequestContext, facetId: ID) => Promise<Translated<Facet> | undefined>;
  findByCode(facetCode: string, lang: LanguageCode) => Promise<Translated<Facet> | undefined>;
  async findByFacetValueId(ctx: RequestContext, id: ID) => Promise<Translated<Facet> | undefined>;
  async create(ctx: RequestContext, input: CreateFacetInput) => Promise<Translated<Facet>>;
  async update(ctx: RequestContext, input: UpdateFacetInput) => Promise<Translated<Facet>>;
  async delete(ctx: RequestContext, id: ID, force: boolean = false) => Promise<DeletionResponse>;
}

Members

constructor

method
type:
(connection: TransactionalConnection, facetValueService: FacetValueService, translatableSaver: TranslatableSaver, listQueryBuilder: ListQueryBuilder, configService: ConfigService, channelService: ChannelService, customFieldRelationService: CustomFieldRelationService) => FacetService

findAll

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

findOne

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

findByCode

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

findByFacetValueId

async method
type:
(ctx: RequestContext, id: ID) => Promise<Translated<Facet> | undefined>
Returns the Facet which contains the given FacetValue id.

create

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

update

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

delete

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