CategoryRepositoryDeleter

Implements \CategoryRepositoryDeleterInterface

Class CategoryRepositoryDeleter

This class deletes category records from the database and is used in the category repository among the classes for writing and reading category records.

category

System

package

Category

subpackage

Repositories

Methods

CategoryRepositoryDeleter constructor.

__construct(\CI_DB_query_builder $db, \ProductRepositoryInterface $productRepository) 

Arguments

$db

\CI_DB_query_builder

Database connector.

$productRepository

\ProductRepositoryInterface

Products repository with functionality to remove products.

Deletes a specific category entity.

deleteById(\IdType $categoryId) : \CategoryRepositoryDeleter

Arguments

$categoryId

\IdType

Category ID.

Response

\CategoryRepositoryDeleter

Same instance for chained method calls.

Deletes related products of given category.

deleteRelatedProductsOfCategory(\IdCollection $categoryIds) : $this|\CategoryRepositoryDeleterInterface

All products that are only connected to the given category gets removed.

Arguments

$categoryIds

\IdCollection

Ids of categories with products to be removed.

Response

$this|\CategoryRepositoryDeleterInterface

Same instance for chained method calls.

Properties

Database connector.

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

productRepository

productRepository : \ProductRepositoryInterface