private function _getProductTextValue($productAttribute) { $value = null; $attributeValue = null; $cacheKey = get_class($this) . "_" . $this->attributes['id'] . "_" . $this->websiteId . "_" . $productAttribute->title; if (Cache::has($cacheKey)) { $value = Cache::get($cacheKey); } else { if (!$this->isDefaultWebsite) { $attributeValue = $productAttribute->productTextValues()->where('product_id', '=', $this->attributes['id'])->where('website_id', '=', $this->websiteId)->get()->first(); } if (null === $attributeValue) { $attributeValue = $productAttribute->productTextValues()->where('product_id', '=', $this->attributes['id'])->where('website_id', '=', $this->defaultWebsiteId)->get()->first(); } if (isset($attributeValue->value)) { $value = $attributeValue->value; Cache::put($cacheKey, $value, $minute = 100); } } return $value; }