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>>;
@Index()
@ManyToOne(type => Asset, asset => asset.featuredInCollections, { onDelete: 'SET NULL' })
featuredAsset: Asset;
@OneToMany(type => CollectionAsset, collectionAsset => collectionAsset.collection)
assets: CollectionAsset[];
@Column('simple-json') filters: ConfigurableOperation[];
@Column({ default: true }) inheritFilters: boolean;
@ManyToMany(type => ProductVariant, productVariant => productVariant.collections)
@JoinTable()
productVariants: ProductVariant[];
@Column(type => CustomCollectionFields)
customFields: CustomCollectionFields;
@TreeChildren()
children: Collection[];
@TreeParent()
parent: Collection;
@EntityId({ nullable: true })
parentId: ID;
@ManyToMany(type => Channel, channel => channel.collections)
@JoinTable()
channels: Channel[];
}
-
Extends:
VendureEntity
-
Implements:
Translatable
,HasCustomFields
,ChannelAware
,Orderable
constructor
method
(input?: DeepPartial<Collection>) => Collection
isRoot
property
boolean
position
property
number
isPrivate
property
boolean
name
property
LocaleString
description
property
LocaleString
slug
property
LocaleString
translations
property
Array<Translation<Collection>>
featuredAsset
property
assets
property
CollectionAsset[]
filters
property
ConfigurableOperation[]
inheritFilters
property
v2.0.0
boolean
productVariants
property
customFields
property
CustomCollectionFields
children
property
parent
property
parentId
property
channels
property
Channel[]