add('

CategoryWriteService overload is used!

This overload will create a new debug log entry whenever you create or update a category record (actually whenever the "createCategory" and "updateCategory" methods are executed). Check the logs admin page for the new entries.

', 'info'); parent::__construct($categoryRepo, $categoryImageStorage, $categoryIconStorage, $productPermissionSetter); } /** * Overload the "createCategory" method. * * This method will create a new debug entry whenever a new category is created. * * @param CategoryInterface $category * * @return int */ public function createCategory(CategoryInterface $category) { $newCategoryId = parent::createCategory($category); $logControl = LogControl::get_instance(); $logControl->notice('CategoryWrite::createCategory >> New category created with ID = ' . $newCategoryId); return $newCategoryId; } /** * Overload the "updateCategory" method. * * This method will create a new debug entry whenever an existing category is updated. * * @param StoredCategoryInterface $category * * @return CategoryWriteService */ public function updateCategory(StoredCategoryInterface $category) { parent::updateCategory($category); $logControl = LogControl::get_instance(); $logControl->notice('CategoryWrite::updateCategory >> Existing category updated with ID = ' . $category->getCategoryId()); return $this; } }