ProductRepositoryDeleteHelper
in package
Class ProductRepositoryDeleteHelper
Table of Contents
- productsContent() : $this|ProductRepositoryDeleteHelper
- Removes product contents, if they are not duplicated.
- propertyCombinationImages() : $this|ProductRepositoryDeleteHelper
- Removes property combination images.
- resetCategoriesAndAlsoPurchasedCache() : $this|ProductRepositoryDeleteHelper
- Reset caches for categories and 'also_purchased', if cache is used.
- _determinePcdIdsToBeRemovedInPcr() : array<string|int, mixed>
- Determines the product content description ids that are used as indicator to remove the right data sets from the product_content_resources table.
- _determinePcIdToBeRemoved() : array<string|int, mixed>
- Determines the product content ids that should be removed by the given product id.
- _removeProductContentByProductId() : $this
- Removes product content data by the given product id.
- _removeProductContentDescriptionEntries() : $this|ProductRepositoryDeleteHelper
- Removes product content description entries by the given product content id.
- _removeProductContentEntries() : $this|ProductRepositoryDeleteHelper
- Removes product content entries by the given product content id.
- _removeProductContentProductsEntries() : $this|ProductRepositoryDeleteHelper
- Removes product content products entries by the given product id.
- _removeProductContentResourceEntries() : $this|ProductRepositoryDeleteHelper
- Removes product content resource entries by the given product content description ids.
- _removeUnusedProductContentFiles() : $this
- Deletes unused product content files from storage.
Methods
productsContent()
Removes product contents, if they are not duplicated.
public
productsContent(IdType $productId, CI_DB_query_builder $db, ProductsContentFileStorage $productsContentFileStorage, ResponsiveFileManagerConfigurationStorage $fileManagerStorage) : $this|ProductRepositoryDeleteHelper
Parameters
- $productId : IdType
-
Product id of content to be removed.
- $db : CI_DB_query_builder
-
Query builder instance to access data.
- $productsContentFileStorage : ProductsContentFileStorage
-
Storage class for product contents.
- $fileManagerStorage : ResponsiveFileManagerConfigurationStorage
-
File manager configuration access.
Return values
$this|ProductRepositoryDeleteHelper —Same instance for chained method calls.
propertyCombinationImages()
Removes property combination images.
public
propertyCombinationImages(IdType $combinationId) : $this|ProductRepositoryDeleteHelper
Parameters
- $combinationId : IdType
-
Combination id of images to be removed.
Return values
$this|ProductRepositoryDeleteHelper —Same instance for chained method calls.
resetCategoriesAndAlsoPurchasedCache()
Reset caches for categories and 'also_purchased', if cache is used.
public
resetCategoriesAndAlsoPurchasedCache() : $this|ProductRepositoryDeleteHelper
Return values
$this|ProductRepositoryDeleteHelper —Same instance for chained method calls.
_determinePcdIdsToBeRemovedInPcr()
Determines the product content description ids that are used as indicator to remove the right data sets from the product_content_resources table.
private
_determinePcdIdsToBeRemovedInPcr(CI_DB_query_builder $db, int $productContentId) : array<string|int, mixed>
Parameters
- $db : CI_DB_query_builder
-
Database access instance.
- $productContentId : int
-
Product content id to be removed.
Return values
array<string|int, mixed> —Product content description ids or an empty array.
_determinePcIdToBeRemoved()
Determines the product content ids that should be removed by the given product id.
private
_determinePcIdToBeRemoved(IdType $productId, CI_DB_query_builder $db) : array<string|int, mixed>
Parameters
- $productId : IdType
-
Id of related product of entries that should be removed.
- $db : CI_DB_query_builder
-
Database access instance.
Return values
array<string|int, mixed> —Ids of product contents to be removed, if there are any.
_removeProductContentByProductId()
Removes product content data by the given product id.
private
_removeProductContentByProductId(IdType $productId, CI_DB_query_builder $db, ProductsContentFileStorage $productsContentFileStorage, ResponsiveFileManagerConfigurationStorage $fileManagerStorage) : $this
Parameters
- $productId : IdType
-
Product id of content data to be removed.
- $db : CI_DB_query_builder
-
Query builder instance to access data.
- $productsContentFileStorage : ProductsContentFileStorage
-
Storage class for product contents.
- $fileManagerStorage : ResponsiveFileManagerConfigurationStorage
-
File manager configuration access.
Return values
$this —_removeProductContentDescriptionEntries()
Removes product content description entries by the given product content id.
private
_removeProductContentDescriptionEntries(CI_DB_query_builder $db, int $pcId) : $this|ProductRepositoryDeleteHelper
Parameters
- $db : CI_DB_query_builder
-
Database access instance.
- $pcId : int
-
Related product content id.
Return values
$this|ProductRepositoryDeleteHelper —Same instance for chained method calls.
_removeProductContentEntries()
Removes product content entries by the given product content id.
private
_removeProductContentEntries(CI_DB_query_builder $db, int $pcId) : $this|ProductRepositoryDeleteHelper
Parameters
- $db : CI_DB_query_builder
-
Database access instance.
- $pcId : int
-
Id of product content record to be removed.
Return values
$this|ProductRepositoryDeleteHelper —Same instance for chained method calls.
_removeProductContentProductsEntries()
Removes product content products entries by the given product id.
private
_removeProductContentProductsEntries(CI_DB_query_builder $db, IdType $productId) : $this|ProductRepositoryDeleteHelper
Parameters
- $db : CI_DB_query_builder
-
Database access instance.
- $productId : IdType
-
Related product id.
Return values
$this|ProductRepositoryDeleteHelper —Same instance for chained method calls.
_removeProductContentResourceEntries()
Removes product content resource entries by the given product content description ids.
private
_removeProductContentResourceEntries(CI_DB_query_builder $db, array<string|int, mixed> $pcdIds) : $this|ProductRepositoryDeleteHelper
Parameters
- $db : CI_DB_query_builder
-
Database access instance.
- $pcdIds : array<string|int, mixed>
-
Related product content description ids.
Return values
$this|ProductRepositoryDeleteHelper —Same instance for chained method calls.
_removeUnusedProductContentFiles()
Deletes unused product content files from storage.
private
_removeUnusedProductContentFiles(int $productContentIdToBeRemoved, CI_DB_query_builder $db, ProductsContentFileStorage $productsContentFileStorage) : $this
Parameters
- $productContentIdToBeRemoved : int
- $db : CI_DB_query_builder
- $productsContentFileStorage : ProductsContentFileStorage