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, channel => channel.facets)
@JoinTable()
channels: Channel[];
}
-
Extends:
VendureEntity
-
Implements:
Translatable
,HasCustomFields
,ChannelAware