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

Methods summary

public __construct( CI_DB_query_builder $db, LanguageProviderInterface $languageProvider )

CategoryRepositoryWriter constructor.

public insert( CategoryInterface $category ) : integer

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

public update( StoredCategoryInterface $category ) : CategoryRepositoryWriter

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

protected _parseCategoryData( CategoryInterface $category )
protected _parseCategoryDescriptionData( CategoryInterface $category, LanguageCode $languageCode )

Properties summary

protected $db : CI_DB_query_builder

		
protected $categoriesTable : string
'categories'
protected $languageProvider : LanguageProviderInterface

$languageProvider