Collection

Collection

Collection

A Collection is a grouping of Products based on various configurable criteria.

Signature

class Collection extends VendureEntity implements Translatable, HasCustomFields, ChannelAware, Orderable {
  constructor(input?: DeepPartial<Collection>)
  @Column({ default: false })
    isRoot: boolean;
  @Column()
    position: number;
  @Column({ default: false })
    isPrivate: boolean;
  name: LocaleString;
  description: LocaleString;
  slug: LocaleString;
  @OneToMany((type) => CollectionTranslation, (translation) => translation.base, { eager: true })
    translations: Array<Translation<Collection>>;
  @ManyToOne((type) => Asset, { onDelete: 'SET NULL' })
    featuredAsset: Asset;
  @OneToMany((type) => CollectionAsset, (collectionAsset) => collectionAsset.collection)
    assets: CollectionAsset[];
  @Column('simple-json') filters: ConfigurableOperation[];
  @ManyToMany((type) => ProductVariant, (productVariant) => productVariant.collections)
    @JoinTable()
    productVariants: ProductVariant[];
  @Column((type) => CustomCollectionFields)
    customFields: CustomCollectionFields;
  @TreeChildren()
    children: Collection[];
  @TreeParent()
    parent: Collection;
  @ManyToMany((type) => Channel)
    @JoinTable()
    channels: Channel[];
}

Extends

Implements

  • Translatable
  • HasCustomFields
  • ChannelAware
  • Orderable

Members

constructor

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

isRoot

property
type:
boolean

position

property
type:
number

isPrivate

property
type:
boolean

name

property
type:
LocaleString

description

property
type:
LocaleString

slug

property
type:
LocaleString

translations

property
type:
Array<Translation<Collection>>

featuredAsset

property
type:
Asset

assets

property
type:
CollectionAsset[]

filters

property
type:
ConfigurableOperation[]

productVariants

property
type:
ProductVariant[]

customFields

property
type:
CustomCollectionFields

children

property
type:
Collection[]

parent

property
type:
Collection

channels

property
type:
Channel[]