Mage2\Catalog\Helpers\ProductHelper::_saveProductVarcharValue PHP Method

_saveProductVarcharValue() private method

private _saveProductVarcharValue ( $product, $identifier, $productAttribute, $value )
    private function _saveProductVarcharValue($product, $identifier, $productAttribute, $value)
    {
        $createNewRecord = false;
        if ($this->isDefaultWebsite == false) {
            $attributeValue = $productAttribute->productVarcharValues()->where('product_id', '=', $product->id)->where('website_id', '=', $this->websiteId)->get()->first();
            if (null === $attributeValue) {
                $createNewRecord = true;
            }
        }
        if (null === $product->{$identifier} || $createNewRecord == true) {
            $productAttribute->productVarcharValues()->create(['product_id' => $product->id, 'website_id' => $this->websiteId, 'value' => $value]);
        } else {
            $productAttribute->productVarcharValues()->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);
        }
    }