CategoryRepositoryWriterInterface
in
Interface CategoryRepositoryWriterInterface
This interface defines methods for creating and updating specific category records in the database and is used in the category repository among the interfaces for reading and deleting category records.
Tags
Table of Contents
- detachMainCategoryFromProducts() : CategoryRepositoryWriter
- Updates the main category ID from the products
- insert() : int
- Inserts a category record into the database accordingly to the provided category object and returns the ID from the saved entity.
- update() : CategoryRepositoryWriterInterface
- Updates an existing category record accordingly to the provided category object.
Methods
detachMainCategoryFromProducts()
Updates the main category ID from the products
public
detachMainCategoryFromProducts(IdType $categoryId) : CategoryRepositoryWriter
Parameters
- $categoryId : IdType
Return values
CategoryRepositoryWriter —insert()
Inserts a category record into the database accordingly to the provided category object and returns the ID from the saved entity.
public
insert(CategoryInterface $category) : int
Parameters
- $category : CategoryInterface
-
The category to insert.
Return values
int —Returns the ID of the new category.
update()
Updates an existing category record accordingly to the provided category object.
public
update(StoredCategoryInterface $category) : CategoryRepositoryWriterInterface
Parameters
- $category : StoredCategoryInterface
-
The category to update.
Return values
CategoryRepositoryWriterInterface —Same instance for chained method calls.