ProductCategoryService
Provides layer to manipulate product categories.
constructor
Parameters
__namedParameters
InjectedDependenciesRequiredProperties
manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequired__container__
anyRequiredEvents
objectRequiredEvents.CREATED
stringRequiredDefault: "product-category.created"
Events.UPDATED
stringRequiredDefault: "product-category.updated"
Events.DELETED
stringRequiredDefault: "product-category.deleted"
__configModule__
Record<string, unknown>__moduleDeclaration__
Record<string, unknown>Accessors
activeManager_
Returns
EntityManager
EntityManagerRequiredMethods
withTransaction
Parameters
transactionManager
EntityManagerReturns
this
thisRequiredshouldRetryTransaction_
Parameters
err
Record<string, unknown> | objectRequiredReturns
boolean
booleanRequiredatomicPhase_
Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created.
Type Parameters
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise
Promise<TResult>RequiredlistAndCount
Lists product category based on the provided parameters and includes the count of product category that match the query.
Parameters
Default: {}
Returns
retrieve_
A generic retrieve for fining product categories by different attributes.
Parameters
Default: {}
Default: {}
Default: {}
Returns
retrieve
Retrieves a product category by id.
Parameters
productCategoryId
stringRequiredDefault: {}
Default: {}
Default: {}
Returns
retrieveByHandle
Retrieves a product category by handle.
Parameters
handle
stringRequiredDefault: {}
Default: {}
Default: {}
Returns
create
Creates a product category
Parameters
productCategoryInput
CreateProductCategoryInputRequiredReturns
update
Updates a product category
Parameters
productCategoryId
stringRequiredproductCategoryInput
UpdateProductCategoryInputRequiredReturns
delete
Deletes a product category
Parameters
productCategoryId
stringRequiredReturns
Promise
Promise<void>RequiredaddProducts
Add a batch of product to a product category
Parameters
productCategoryId
stringRequiredproductIds
string[]RequiredReturns
Promise
Promise<void>RequiredremoveProducts
Remove a batch of product from a product category
Parameters
productCategoryId
stringRequiredproductIds
string[]RequiredReturns
Promise
Promise<void>RequiredfetchReorderConditions
Parameters
input
UpdateProductCategoryInputRequiredshouldDeleteElement
booleanRequiredDefault: false
Returns
ReorderConditions
ReorderConditionsRequiredperformReordering
Parameters
conditions
ReorderConditionsRequiredReturns
Promise
Promise<void>RequiredshiftSiblings
Parameters
conditions
ReorderConditionsRequiredReturns
Promise
Promise<void>RequiredtransformParentIdToEntity
Accepts an input object and transforms product_category_id into product_category entity.
Parameters
productCategoryInput
CreateProductCategoryInput | UpdateProductCategoryInputRequiredReturns
Promise
Promise<CreateProductCategoryInput | UpdateProductCategoryInput>Required