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 ProductRepository

Class ProductRepository

ProductRepository implements ProductRepositoryInterface
Package: Product\Repositories
Category: System
Located at CoreServices/Product/Repositories/ProductRepository.inc.php

Methods summary

public
# __construct( ProductRepositoryReaderInterface $reader, ProductRepositoryWriterInterface $writer, ProductRepositoryDeleterInterface $deleter, ProductSettingsRepositoryInterface $settingsRepo, AddonValueServiceInterface $addonValueService, ProductImageContainerRepositoryInterface $imageContainerRepo )

Initialize the product repository.

Initialize the product repository.

Parameters

$reader
Instance to perform db read actions.
$writer
Instance to perform db write actions.
$deleter
Instance to perform db delete actions.
$settingsRepo

Repository instance to read/write/delete product settings.

$addonValueService
Service to handle product addon values.
$imageContainerRepo
Image container of the product.
public integer
# add( ProductInterface $product )

Adds a new product in the database.

Adds a new product in the database.

Parameters

$product
Product entity which holds the values for the database columns.

Returns

integer
Id of inserted product.

Throws

InvalidArgumentException
If the provided product is not valid.

Implementation of

ProductRepositoryInterface::add()
public ProductRepositoryInterface|ProductRepository
# store( StoredProductInterface $product )

Updates an existing product in the database.

Updates an existing product in the database.

Parameters

$product
Product entity to update.

Returns

ProductRepositoryInterface|ProductRepository
$this Same instance for chained method calls.

Throws

InvalidArgumentException
If the provided product is not valid.

Implementation of

ProductRepositoryInterface::store()
public StoredProductInterface
# getProductById( IdType $productId )

Gets a stored product by the given id.

Gets a stored product by the given id.

Parameters

$productId
Id of expected product entity.

Returns

StoredProductInterface
Product entity with the expected product id.

Implementation of

ProductRepositoryInterface::getProductById()
public ProductRepositoryInterface|ProductRepository
# deleteProductById( IdType $productId )

Removes a product from the database by the given id.

Removes a product from the database by the given id.

Parameters

$productId
Id of expected product entity.

Returns

ProductRepositoryInterface|ProductRepository
$this Same instance for chained method calls.

Implementation of

ProductRepositoryInterface::deleteProductById()

Properties summary

protected ProductRepositoryReaderInterface $reader
#
protected ProductRepositoryWriterInterface $writer
#
protected ProductRepositoryDeleterInterface $deleter
#
protected ProductSettingsRepositoryInterface $settingsRepo
#
protected AddonValueServiceInterface $addonValueService
#
protected ProductImageContainerRepositoryInterface $imageContainerRepo
#
API documentation generated by ApiGen