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 ProductRepositoryWriter

Class ProductRepositoryWriter

ProductRepositoryWriter implements ProductRepositoryWriterInterface
Package: Product\Repositories
Category: System
Located at CoreServices/Product/Repositories/Writer/ProductRepositoryWriter.inc.php

Methods summary

public
# __construct( CI_DB_query_builder $db, YetAnotherLanguageProvider $languageProvider )

ProductRepositoryWriter constructor.

ProductRepositoryWriter constructor.

Parameters

$db
$languageProvider

Throws

InvalidArgumentException
public integer
# insert( ProductInterface $product )

Insert

Insert

Saves 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.
UnexpectedValueException
When no language id was found by the given language code.

Implementation of

ProductRepositoryWriterInterface::insert()
public ProductRepositoryWriter
# update( StoredProductInterface $product )

Update

Update

Updates a product in the database.

Parameters

$product
Product entity to update.

Returns

ProductRepositoryWriter
Same instance for chained method calls.

Throws

InvalidArgumentException
UnexpectedValueException
When no language id was found by the given language code.

Implementation of

ProductRepositoryWriterInterface::update()
protected array
# _parseProductData( ProductInterface $product )

Convert the product instance data to an array.

Convert the product instance data to an array.

Parameters

$product

Returns

array
protected array
# _parseProductDescriptionData( ProductInterface $product, LanguageCode $languageCode )

Convert the product description instance data to an array.

Convert the product description instance data to an array.

Parameters

$product
$languageCode

Returns

array

Throws

InvalidArgumentException
If the provided language code or product is not valid.

Properties summary

protected CI_DB_query_builder $db

The database connection.

The database connection.

#
protected YetAnotherLanguageProvider $languageProvider

Used for fetching the language data.

Used for fetching the language data.

#
API documentation generated by ApiGen