🚨 Announcing Vendure v2 Beta

Facet

Facet

A Facet is a class of properties which can be applied to a Product or ProductVariant. They are used to enable faceted search whereby products can be filtered along a number of dimensions (facets).

For example, there could be a Facet named “Brand” which has a number of FacetValues representing the various brands of product, e.g. “Apple”, “Samsung”, “Dell”, “HP” etc.

Signature

class Facet extends VendureEntity implements Translatable, HasCustomFields, ChannelAware {
  constructor(input?: DeepPartial<Facet>)
  name: LocaleString;
  @Column({ default: false })
    isPrivate: boolean;
  @Column({ unique: true })
    code: string;
  @OneToMany(type => FacetTranslation, translation => translation.base, { eager: true })
    translations: Array<Translation<Facet>>;
  @OneToMany(type => FacetValue, value => value.facet)
    values: FacetValue[];
  @Column(type => CustomFacetFields)
    customFields: CustomFacetFields;
  @ManyToMany(type => Channel)
    @JoinTable()
    channels: Channel[];
}

Extends

Implements

Members

constructor

method
type:
(input?: DeepPartial<Facet>) => Facet

name

property
type:
LocaleString

isPrivate

property
type:
boolean

code

property
type:
string

translations

property
type:
Array<Translation<Facet>>

values

property
type:
FacetValue[]

customFields

property
type:
CustomFacetFields

channels

property
type:
Channel[]