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 }) @Column({ default: false })
isRoot: boolean;
@Column() @Column()
position: number;
@Column({ default: false }) @Column({ default: false })
isPrivate: boolean;
name: LocaleString;
description: LocaleString;
slug: LocaleString;
@OneToMany(type => CollectionTranslation, translation => translation.base, { eager: true }) @OneToMany(type => CollectionTranslation, translation => translation.base, { eager: true })
translations: Array<Translation<Collection>>;
@Index() @ManyToOne(type => Asset, { onDelete: 'SET NULL' }) @Index()
@ManyToOne(type => Asset, { onDelete: 'SET NULL' })
featuredAsset: Asset;
@OneToMany(type => CollectionAsset, collectionAsset => collectionAsset.collection) @OneToMany(type => CollectionAsset, collectionAsset => collectionAsset.collection)
assets: CollectionAsset[];
@Column('simple-json') @Column('simple-json') filters: ConfigurableOperation[];
@Column({ default: true }) @Column({ default: true }) inheritFilters: boolean;
@ManyToMany(type => ProductVariant, productVariant => productVariant.collections) @JoinTable() @ManyToMany(type => ProductVariant, productVariant => productVariant.collections)
@JoinTable()
productVariants: ProductVariant[];
@Column(type => CustomCollectionFields) @Column(type => CustomCollectionFields)
customFields: CustomCollectionFields;
@TreeChildren() @TreeChildren()
children: Collection[];
@TreeParent() @TreeParent()
parent: Collection;
@EntityId({ nullable: true }) @EntityId({ nullable: true })
parentId: ID;
@ManyToMany(type => Channel) @JoinTable() @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[]
inheritFilters
property
v2.0.0
type:
boolean
productVariants
property
type:
ProductVariant[]
customFields
property
type:
CustomCollectionFields
children
property
type:
Collection[]
parent
property
type:
Collection
parentId
property
type:
ID
channels
property
type:
Channel[]