Skip to main content

Class: ProductVariantRepository

backend.ProductVariantRepository

Hierarchy#

Table of contents#

Constructors#

Properties#

Methods#

Constructors#

constructor#

• new ProductVariantRepository()

Overrides#

BaseRepository.constructor

Defined in#

system/core/backend/src/repositories/product-variant.repository.ts:21

Properties#

dbType#

• dbType: "mysql" | "mariadb" | "postgres" | "cockroachdb" | "sqlite" | "mssql" | "sap" | "oracle" | "cordova" | "nativescript" | "react-native" | "sqljs" | "mongodb" | "aurora-data-api" | "aurora-data-api-pg" | "expo" | "better-sqlite3" | "capacitor"

Inherited from#

BaseRepository.dbType

Defined in#

system/core/backend/src/repositories/base.repository.ts:24

Methods#

applyBaseFilter#

â–¸ applyBaseFilter<EntityType>(qb, filter?): SelectQueryBuilder<EntityType>

Type parameters#

NameType
EntityTypeTBasePageEntity

Parameters#

NameType
qbSelectQueryBuilder<EntityType>
filter?BaseFilterInput

Returns#

SelectQueryBuilder<EntityType>

Inherited from#

BaseRepository.applyBaseFilter

Defined in#

system/core/backend/src/repositories/base.repository.ts:155


applyDeleteMany#

â–¸ applyDeleteMany(qb, input): Promise<void>

Parameters#

NameType
qbSelectQueryBuilder<ProductVariant> | DeleteQueryBuilder<ProductVariant>
inputTDeleteManyInput

Returns#

Promise<void>

Inherited from#

BaseRepository.applyDeleteMany

Defined in#

system/core/backend/src/repositories/base.repository.ts:108


applyGetEntityViews#

â–¸ applyGetEntityViews(qb, entityType): SelectQueryBuilder<TBasePageEntity>

Parameters#

NameType
qbSelectQueryBuilder<TBasePageEntity>
entityTypeEDBEntity

Returns#

SelectQueryBuilder<TBasePageEntity>

Inherited from#

BaseRepository.applyGetEntityViews

Defined in#

system/core/backend/src/repositories/base.repository.ts:133


applyProductVariantFilter#

â–¸ applyProductVariantFilter(qb, filterParams?): void

Parameters#

NameType
qbSelectQueryBuilder<TProductVariant>
filterParams?BaseFilterInput

Returns#

void

Defined in#

system/core/backend/src/repositories/product-variant.repository.ts:90


createEntity#

â–¸ createEntity(input, id?): Promise<ProductVariant>

Parameters#

NameType
inputProductVariant
id?null | number

Returns#

Promise<ProductVariant>

Inherited from#

BaseRepository.createEntity

Defined in#

system/core/backend/src/repositories/base.repository.ts:70


createProductVariant#

â–¸ createProductVariant(createProductVariant, id?, product?): Promise<ProductVariant>

Parameters#

NameType
createProductVariantTProductVariantInput
id?null | number
product?Product

Returns#

Promise<ProductVariant>

Defined in#

system/core/backend/src/repositories/product-variant.repository.ts:59


deleteEntity#

â–¸ deleteEntity(id): Promise<boolean>

Parameters#

NameType
idnumber

Returns#

Promise<boolean>

Inherited from#

BaseRepository.deleteEntity

Defined in#

system/core/backend/src/repositories/base.repository.ts:97


deleteMany#

â–¸ deleteMany(input): Promise<boolean>

Parameters#

NameType
inputTDeleteManyInput

Returns#

Promise<boolean>

Inherited from#

BaseRepository.deleteMany

Defined in#

system/core/backend/src/repositories/base.repository.ts:125


deleteManyFilteredProductVariants#

â–¸ deleteManyFilteredProductVariants(input, filterParams?): Promise<undefined | boolean>

Parameters#

NameType
inputTDeleteManyInput
filterParams?BaseFilterInput

Returns#

Promise<undefined | boolean>

Defined in#

system/core/backend/src/repositories/product-variant.repository.ts:102


deleteProductVariant#

â–¸ deleteProductVariant(id): Promise<boolean>

Parameters#

NameType
idnumber

Returns#

Promise<boolean>

Defined in#

system/core/backend/src/repositories/product-variant.repository.ts:79


getAll#

â–¸ getAll(): Promise<ProductVariant[]>

Returns#

Promise<ProductVariant[]>

Inherited from#

BaseRepository.getAll

Defined in#

system/core/backend/src/repositories/base.repository.ts:44


getById#

â–¸ getById(id, relations?): Promise<ProductVariant>

Parameters#

NameType
idnumber
relations?string[]

Returns#

Promise<ProductVariant>

Inherited from#

BaseRepository.getById

Defined in#

system/core/backend/src/repositories/base.repository.ts:49


getBySlug#

â–¸ getBySlug(slug, relations?): Promise<ProductVariant>

Parameters#

NameType
slugstring
relations?string[]

Returns#

Promise<ProductVariant>

Inherited from#

BaseRepository.getBySlug

Defined in#

system/core/backend/src/repositories/base.repository.ts:60


getEntityViews#

â–¸ getEntityViews(entityId, entityType): Promise<any>

Parameters#

NameType
entityIdnumber
entityTypeEDBEntity

Returns#

Promise<any>

Inherited from#

BaseRepository.getEntityViews

Defined in#

system/core/backend/src/repositories/base.repository.ts:144


getFilteredEntities#

â–¸ getFilteredEntities(pagedParams?, filterParams?): Promise<TPagedList<ProductVariant>>

Parameters#

NameType
pagedParams?PagedParamsInput<ProductVariant>
filterParams?BaseFilterInput

Returns#

Promise<TPagedList<ProductVariant>>

Inherited from#

BaseRepository.getFilteredEntities

Defined in#

system/core/backend/src/repositories/base.repository.ts:164


getFilteredProductVariants#

â–¸ getFilteredProductVariants(pagedParams?, filterParams?): Promise<TPagedList<TProductVariant>>

Parameters#

NameType
pagedParams?PagedParamsInput<TProductVariant>
filterParams?BaseFilterInput

Returns#

Promise<TPagedList<TProductVariant>>

Defined in#

system/core/backend/src/repositories/product-variant.repository.ts:94


getPaged#

â–¸ getPaged(params?): Promise<TPagedList<ProductVariant>>

Parameters#

NameType
params?TPagedParams<ProductVariant>

Returns#

Promise<TPagedList<ProductVariant>>

Inherited from#

BaseRepository.getPaged

Defined in#

system/core/backend/src/repositories/base.repository.ts:38


getProductVariant#

â–¸ getProductVariant(id): Promise<ProductVariant>

Parameters#

NameType
idnumber

Returns#

Promise<ProductVariant>

Defined in#

system/core/backend/src/repositories/product-variant.repository.ts:29


getProductVariants#

â–¸ getProductVariants(params): Promise<TPagedList<TProductVariant>>

Parameters#

NameType
paramsTPagedParams<TProductVariant>

Returns#

Promise<TPagedList<TProductVariant>>

Defined in#

system/core/backend/src/repositories/product-variant.repository.ts:25


getSqlBoolStr#

â–¸ getSqlBoolStr(b): "true" | "false" | "1" | "0"

Parameters#

NameType
bboolean

Returns#

"true" | "false" | "1" | "0"

Inherited from#

BaseRepository.getSqlBoolStr

Defined in#

system/core/backend/src/repositories/base.repository.ts:34


getSqlLike#

â–¸ getSqlLike(): "ILIKE" | "LIKE"

Returns#

"ILIKE" | "LIKE"

Inherited from#

BaseRepository.getSqlLike

Defined in#

system/core/backend/src/repositories/base.repository.ts:35


handleProductVariantInput#

â–¸ handleProductVariantInput(productVariant, input, action, product?): Promise<void>

Parameters#

NameType
productVariantProductVariant
inputTProductVariantInput
action"update" | "create"
product?null | Product

Returns#

Promise<void>

Defined in#

system/core/backend/src/repositories/product-variant.repository.ts:34


handleVariantsInputForProduct#

â–¸ handleVariantsInputForProduct(product, variants): Promise<ProductVariant[]>

Parameters#

NameType
productProduct
variantsTProductVariantInput[]

Returns#

Promise<ProductVariant[]>

Defined in#

system/core/backend/src/repositories/product-variant.repository.ts:115


quote#

â–¸ quote(str): string

Parameters#

NameType
strstring

Returns#

string

Inherited from#

BaseRepository.quote

Defined in#

system/core/backend/src/repositories/base.repository.ts:36


updateEntity#

â–¸ updateEntity(id, input): Promise<ProductVariant>

Parameters#

NameType
idnumber
inputProductVariant

Returns#

Promise<ProductVariant>

Inherited from#

BaseRepository.updateEntity

Defined in#

system/core/backend/src/repositories/base.repository.ts:82


updateProductVariant#

â–¸ updateProductVariant(id, updateProductVariant, product?): Promise<ProductVariant>

Parameters#

NameType
idnumber
updateProductVariantTProductVariantInput
product?Product

Returns#

Promise<ProductVariant>

Defined in#

system/core/backend/src/repositories/product-variant.repository.ts:70