Class: ProductRepository
backend.ProductRepository
#
Hierarchy↳
ProductRepository
#
Table of contents#
Constructors#
Properties#
Methods- applyAndGetPagedProducts
- applyBaseFilter
- applyDeleteMany
- applyGetEntityViews
- applyGetProductRating
- applyProductFilter
- attributeRecordsToProductAttributeInstances
- createEntity
- createProduct
- deleteEntity
- deleteMany
- deleteManyFilteredProducts
- deleteProduct
- getAll
- getById
- getBySlug
- getEntityViews
- getFilteredEntities
- getFilteredProducts
- getPaged
- getProductAttributes
- getProductById
- getProductBySlug
- getProductRating
- getProductVariantsOfProduct
- getProducts
- getProductsFromCategory
- getReviewsOfProduct
- getSqlBoolStr
- getSqlLike
- handleProductInput
- quote
- updateEntity
- updateProduct
#
Constructors#
constructor• new ProductRepository()
#
Overrides#
Defined insystem/core/backend/src/repositories/product.repository.ts:54
#
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#
Defined insystem/core/backend/src/repositories/base.repository.ts:24
#
Methods#
applyAndGetPagedProductsâ–¸ applyAndGetPagedProducts(qb
, params?
): Promise
<TPagedList
<TProduct
>>
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <TProduct > |
params? | TPagedParams <TProduct > |
#
ReturnsPromise
<TPagedList
<TProduct
>>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:69
#
applyBaseFilterâ–¸ applyBaseFilter<EntityType
>(qb
, filter?
): SelectQueryBuilder
<EntityType
>
#
Type parametersName | Type |
---|---|
EntityType | TBasePageEntity |
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <EntityType > |
filter? | BaseFilterInput |
#
ReturnsSelectQueryBuilder
<EntityType
>
#
Inherited fromBaseRepository.applyBaseFilter
#
Defined insystem/core/backend/src/repositories/base.repository.ts:155
#
applyDeleteManyâ–¸ applyDeleteMany(qb
, input
): Promise
<void
>
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <Product > | DeleteQueryBuilder <Product > |
input | TDeleteManyInput |
#
ReturnsPromise
<void
>
#
Inherited fromBaseRepository.applyDeleteMany
#
Defined insystem/core/backend/src/repositories/base.repository.ts:108
#
applyGetEntityViewsâ–¸ applyGetEntityViews(qb
, entityType
): SelectQueryBuilder
<TBasePageEntity
>
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <TBasePageEntity > |
entityType | EDBEntity |
#
ReturnsSelectQueryBuilder
<TBasePageEntity
>
#
Inherited fromBaseRepository.applyGetEntityViews
#
Defined insystem/core/backend/src/repositories/base.repository.ts:133
#
applyGetProductRatingâ–¸ applyGetProductRating(qb
): void
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <TProduct > |
#
Returnsvoid
#
Defined insystem/core/backend/src/repositories/product.repository.ts:58
#
applyProductFilterâ–¸ applyProductFilter(qb
, filterParams?
): void
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <Product > |
filterParams? | ProductFilterInput |
#
Returnsvoid
#
Defined insystem/core/backend/src/repositories/product.repository.ts:302
#
attributeRecordsToProductAttributeInstancesâ–¸ attributeRecordsToProductAttributeInstances(records?
): undefined
| AttributeInstance
[]
#
ParametersName | Type |
---|---|
records? | null | AttributeToProduct [] |
#
Returnsundefined
| AttributeInstance
[]
#
Defined insystem/core/backend/src/repositories/product.repository.ts:438
#
createEntityâ–¸ createEntity(input
, id?
): Promise
<Product
>
#
ParametersName | Type |
---|---|
input | Product |
id? | null | number |
#
ReturnsPromise
<Product
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:70
#
createProductâ–¸ createProduct(createProduct
, id?
): Promise
<Product
>
#
ParametersName | Type |
---|---|
createProduct | TProductInput |
id? | null | number |
#
ReturnsPromise
<Product
>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:235
#
deleteEntityâ–¸ deleteEntity(id
): Promise
<boolean
>
#
ParametersName | Type |
---|---|
id | number |
#
ReturnsPromise
<boolean
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:97
#
deleteManyâ–¸ deleteMany(input
): Promise
<boolean
>
#
ParametersName | Type |
---|---|
input | TDeleteManyInput |
#
ReturnsPromise
<boolean
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:125
#
deleteManyFilteredProductsâ–¸ deleteManyFilteredProducts(input
, filterParams?
): Promise
<undefined
| boolean
>
#
ParametersName | Type |
---|---|
input | TDeleteManyInput |
filterParams? | ProductFilterInput |
#
ReturnsPromise
<undefined
| boolean
>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:425
#
deleteProductâ–¸ deleteProduct(id
): Promise
<boolean
>
#
ParametersName | Type |
---|---|
id | number |
#
ReturnsPromise
<boolean
>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:258
#
getAllâ–¸ getAll(): Promise
<Product
[]>
#
ReturnsPromise
<Product
[]>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:44
#
getByIdâ–¸ getById(id
, relations?
): Promise
<Product
>
#
ParametersName | Type |
---|---|
id | number |
relations? | string [] |
#
ReturnsPromise
<Product
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:49
#
getBySlugâ–¸ getBySlug(slug
, relations?
): Promise
<Product
>
#
ParametersName | Type |
---|---|
slug | string |
relations? | string [] |
#
ReturnsPromise
<Product
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:60
#
getEntityViewsâ–¸ getEntityViews(entityId
, entityType
): Promise
<any
>
#
ParametersName | Type |
---|---|
entityId | number |
entityType | EDBEntity |
#
ReturnsPromise
<any
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:144
#
getFilteredEntitiesâ–¸ getFilteredEntities(pagedParams?
, filterParams?
): Promise
<TPagedList
<Product
>>
#
ParametersName | Type |
---|---|
pagedParams? | PagedParamsInput <Product > |
filterParams? | BaseFilterInput |
#
ReturnsPromise
<TPagedList
<Product
>>
#
Inherited fromBaseRepository.getFilteredEntities
#
Defined insystem/core/backend/src/repositories/base.repository.ts:164
#
getFilteredProductsâ–¸ getFilteredProducts(pagedParams?
, filterParams?
): Promise
<TFilteredProductList
>
#
ParametersName | Type |
---|---|
pagedParams? | PagedParamsInput <TProduct > |
filterParams? | ProductFilterInput |
#
ReturnsPromise
<TFilteredProductList
>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:372
#
getPagedâ–¸ getPaged(params?
): Promise
<TPagedList
<Product
>>
#
ParametersName | Type |
---|---|
params? | TPagedParams <Product > |
#
ReturnsPromise
<TPagedList
<Product
>>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:38
#
getProductAttributesâ–¸ getProductAttributes(productId
): Promise
<undefined
| AttributeInstance
[]>
#
ParametersName | Type |
---|---|
productId | number |
#
ReturnsPromise
<undefined
| AttributeInstance
[]>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:456
#
getProductByIdâ–¸ getProductById(id
, options?
): Promise
<undefined
| Product
>
#
ParametersName | Type |
---|---|
id | number |
options? | TGetProductOptions |
#
ReturnsPromise
<undefined
| Product
>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:90
#
getProductBySlugâ–¸ getProductBySlug(slug
, options?
): Promise
<undefined
| Product
>
#
ParametersName | Type |
---|---|
slug | string |
options? | TGetProductOptions |
#
ReturnsPromise
<undefined
| Product
>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:105
#
getProductRatingâ–¸ getProductRating(productId
): Promise
<TProductRating
>
#
ParametersName | Type |
---|---|
productId | number |
#
ReturnsPromise
<TProductRating
>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:286
#
getProductVariantsOfProductâ–¸ getProductVariantsOfProduct(productId
): Promise
<undefined
| null
| ProductVariant
[]>
#
ParametersName | Type |
---|---|
productId | number |
#
ReturnsPromise
<undefined
| null
| ProductVariant
[]>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:462
#
getProductsâ–¸ getProducts(params?
): Promise
<TPagedList
<TProduct
>>
#
ParametersName | Type |
---|---|
params? | TPagedParams <TProduct > |
#
ReturnsPromise
<TPagedList
<TProduct
>>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:84
#
getProductsFromCategoryâ–¸ getProductsFromCategory(categoryId
, params?
): Promise
<TPagedList
<TProduct
>>
#
ParametersName | Type |
---|---|
categoryId | number |
params? | TPagedParams <TProduct > |
#
ReturnsPromise
<TPagedList
<TProduct
>>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:269
#
getReviewsOfProductâ–¸ getReviewsOfProduct(productId
, params?
): Promise
<TPagedList
<TProductReview
>>
#
ParametersName | Type |
---|---|
productId | number |
params? | TPagedParams <TProductReview > |
#
ReturnsPromise
<TPagedList
<TProductReview
>>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:277
#
getSqlBoolStrâ–¸ getSqlBoolStr(b
): "true"
| "false"
| "1"
| "0"
#
ParametersName | Type |
---|---|
b | boolean |
#
Returns"true"
| "false"
| "1"
| "0"
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:34
#
getSqlLikeâ–¸ getSqlLike(): "ILIKE"
| "LIKE"
#
Returns"ILIKE"
| "LIKE"
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:35
#
handleProductInputâ–¸ handleProductInput(product
, input
, action
): Promise
<void
>
#
ParametersName | Type |
---|---|
product | Product |
input | TProductInput |
action | "update" | "create" |
#
ReturnsPromise
<void
>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:133
#
quoteâ–¸ quote(str
): string
#
ParametersName | Type |
---|---|
str | string |
#
Returnsstring
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:36
#
updateEntityâ–¸ updateEntity(id
, input
): Promise
<Product
>
#
ParametersName | Type |
---|---|
id | number |
input | Product |
#
ReturnsPromise
<Product
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:82
#
updateProductâ–¸ updateProduct(id
, updateProduct
): Promise
<Product
>
#
ParametersName | Type |
---|---|
id | number |
updateProduct | TProductInput |
#
ReturnsPromise
<Product
>
#
Defined insystem/core/backend/src/repositories/product.repository.ts:245