private function _saveProductTextValue($product, $identifier, $productAttribute, $value) { $createNewRecord = false; if ($this->isDefaultWebsite == false) { $attributeValue = $productAttribute->productTextValues()->where('product_id', '=', $product->id)->where('website_id', '=', $this->websiteId)->get()->first(); if (null === $attributeValue) { $createNewRecord = true; } } if (null === $product->{$identifier} || $createNewRecord == true) { $productAttribute->productTextValues()->create(['product_id' => $product->id, 'website_id' => $this->websiteId, 'value' => $value]); } else { $productAttribute->productTextValues()->where('product_id', '=', $product->id)->get()->first()->update(['value' => $value, 'website_id' => $this->websiteId]); $cacheKey = get_class($product) . "_" . $product->id . "_" . $this->websiteId . "_" . $productAttribute->title; Cache::forget($cacheKey); } }