Skip to main content

Class: ProductTypeService

Provides layer to manipulate products.

Hierarchy

  • "medusa-interfaces"

    ProductTypeService

Constructors

constructor

new ProductTypeService(__namedParameters)

Parameters

NameType
__namedParametersObject

Overrides

BaseService.constructor

Defined in

services/product-type.ts:16

Properties

manager_

Private manager_: EntityManager

Defined in

services/product-type.ts:14


typeRepository_

Private typeRepository_: typeof ProductTypeRepository

Defined in

services/product-type.ts:15

Methods

list

list(selector?, config?): Promise<ProductType[]>

Lists product types

Parameters

NameTypeDescription
selectorFilterableProductTypePropsthe query object for find
configFindConfig<ProductType>the config to be used for find

Returns

Promise<ProductType[]>

the result of the find operation

Defined in

services/product-type.ts:72


listAndCount

listAndCount(selector?, config?): Promise<[ProductType[], number]>

Lists product tags and adds count.

Parameters

NameTypeDescription
selectorFilterableProductTypePropsthe query object for find
configFindConfig<ProductType>the config to be used for find

Returns

Promise<[ProductType[], number]>

the result of the find operation

Defined in

services/product-type.ts:88


retrieve

retrieve(id, config?): Promise<ProductType>

Gets a product by id. Throws in case of DB Error and if product was not found.

Parameters

NameTypeDescription
idstringid of the product to get.
configFindConfig<ProductType>object that defines what should be included in the query response

Returns

Promise<ProductType>

the result of the find one operation.

Defined in

services/product-type.ts:47


withTransaction

withTransaction(transactionManager): ProductTypeService

Parameters

NameType
transactionManagerEntityManager

Returns

ProductTypeService

Defined in

services/product-type.ts:23