OrderableAsset

OrderableAsset

This base class is extended in order to enable specific ordering of the one-to-many Entity -> Assets relation. Using a many-to-many relation does not provide a way to guarantee order of the Assets, so this entity is used in place of the usual join table that would be created by TypeORM. See https://typeorm.io/#/many-to-many-relations/many-to-many-relations-with-custom-properties

Signature

class OrderableAsset extends VendureEntity implements Orderable {
  constructor(input?: DeepPartial<OrderableAsset>)
  @Column()
    assetId: ID;
  @ManyToOne(type => Asset, { eager: true, onDelete: 'CASCADE' })
    asset: Asset;
  @Column()
    position: number;
}

Extends

Implements

Members

constructor

protected method
type:
(input?: DeepPartial<OrderableAsset>) => OrderableAsset

assetId

property
type:
ID

asset

property
type:
Asset

position

property
type:
number