/** * Save operation * * @param Swatch $swatch * @param integer $optionId * @param integer $storeId * @param integer $type * @param string $value * @return void */ protected function saveSwatchData($swatch, $optionId, $storeId, $type, $value) { if ($this->isSwatchExists) { $swatch->setData('type', $type); $swatch->setData('value', $value); } else { $swatch->setData('option_id', $optionId); $swatch->setData('store_id', $storeId); $swatch->setData('type', $type); $swatch->setData('value', $value); } $swatch->save(); }