Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • ApiV2Controllers
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Validation
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • None
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • Shared
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository

Classes

  • ProductCategoryLinker
  • ProductImageContainerRepository
  • ProductPermissionSetter
  • ProductRepository
  • ProductRepositoryDeleter
  • ProductRepositoryReader
  • ProductRepositoryWriter
  • ProductSettingsRepository
  • ProductSettingsRepositoryReader
  • ProductSettingsRepositoryWriter

Class ProductCategoryLinker

Class ProductCategoryLinker

ProductCategoryLinker implements ProductCategoryLinkerInterface
Package: Product\Repositories
Category: System
Located at CoreServices/Product/Repositories/ProductCategoryLinker.inc.php

Methods summary

public
# __construct( CI_DB_query_builder $db )

Initialize the product category linker.

Initialize the product category linker.

Parameters

$db
Database connector.
public
# linkProduct( IdType $productId, IdType $targetCategoryId )

Links a product to a category.

Links a product to a category.

Parameters

$productId
Product ID.
$targetCategoryId
Target category ID.

Returns


$this|ProductCategoryLinker Same instance for chained method calls.

Implementation of

ProductCategoryLinkerInterface::linkProduct()
public
# changeProductLink( IdType $productId, IdType $currentCategoryId, IdType $newCategoryId )

Changes a link to a new category.

Changes a link to a new category.

Parameters

$productId
Product ID.
$currentCategoryId
Category ID which the product is linked to.
$newCategoryId
New category to be linked to.

Returns


$this|ProductCategoryLinker Same instance for chained method calls.

Implementation of

ProductCategoryLinkerInterface::changeProductLink()
public
# deleteProductLink( IdType $productId, IdType $categoryId )

Removes a link to a category.

Removes a link to a category.

Parameters

$productId
Product ID.
$categoryId
Category ID which the link should be removed to.

Returns


$this|ProductCategoryLinker Same instance for chained method calls.

Implementation of

ProductCategoryLinkerInterface::deleteProductLink()
public
# deleteProductLinks( IdType $productId )

Removes all links from a product.

Removes all links from a product.

Parameters

$productId
Product ID.

Returns


$this|ProductCategoryLinker Same instance for chained method calls.

Implementation of

ProductCategoryLinkerInterface::deleteProductLinks()
public IdCollection
# getProductLinks( IdType $productId )

Returns the category Ids which are linked with given product id.

Returns the category Ids which are linked with given product id.

Parameters

$productId
Product ID.

Returns

IdCollection

Implementation of

ProductCategoryLinkerInterface::getProductLinks()

Properties summary

protected CI_DB_query_builder $db
#
protected string $tableName
# 'products_to_categories'
API documentation generated by ApiGen