/** * {@inheritdoc} */ public function update($categoryId, CategoryDataObject $category) { $model = $this->loadCategory($categoryId); try { $this->categoryMapper->toModel($category, $model); $this->validateCategory($model); $model->save(); } catch (\Exception $e) { throw new CouldNotSaveException('Could not save category', [], $e); } return true; }