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

  • CategoryRepository
  • CategoryRepositoryDeleter
  • CategoryRepositoryReader
  • CategoryRepositoryWriter
  • CategorySettingsRepository
  • CategorySettingsRepositoryReader
  • CategorySettingsRepositoryWriter

Class CategoryRepositoryWriter

Class CategoryRepositoryWriter

This class provides methods for creating and updating specific category records in the database and is used in the category repository among the classes for reading and deleting category records.

CategoryRepositoryWriter implements CategoryRepositoryWriterInterface
Package: Category\Repositories
Category: System
Located at CoreServices/Category/Repositories/Writer/CategoryRepositoryWriter.php

Methods summary

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

CategoryRepositoryWriter constructor.

CategoryRepositoryWriter constructor.

Parameters

$db
Database connector.
$languageHelper
public integer
# insert( CategoryInterface $category )

Inserts a category record into the database accordingly to the provided category object and returns the ID from the saved entity.

Inserts a category record into the database accordingly to the provided category object and returns the ID from the saved entity.

Parameters

$category
The category to insert.

Returns

integer
Returns the ID of the new category.

Throws

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

Implementation of

CategoryRepositoryWriterInterface::insert()
public CategoryRepositoryWriter
# update( StoredCategoryInterface $category )

Updates an existing category record accordingly to the provided category object.

Updates an existing category record accordingly to the provided category object.

Parameters

$category
The category to update.

Returns

CategoryRepositoryWriter
Same instance for chained method calls.

Throws

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

Implementation of

CategoryRepositoryWriterInterface::update()
protected
# _parseCategoryData( CategoryInterface $category )
protected
# _parseCategoryDescriptionData( CategoryInterface $category, LanguageCode $languageCode )

Properties summary

protected CI_DB_query_builder $db
#
protected string $categoriesTable
# 'categories'
protected YetAnotherLanguageProvider $languageProvider

$languageProvider

$languageProvider

#
API documentation generated by ApiGen