PATH:
home
/
lab2454c
/
vaultchip.com
/
platform
/
plugins
/
ecommerce
/
src
/
Repositories
/
Caches
<?php namespace Botble\Ecommerce\Repositories\Caches; use Botble\Ecommerce\Repositories\Interfaces\ProductCategoryInterface; use Botble\Ecommerce\Repositories\Interfaces\ProductCollectionInterface; use Botble\Ecommerce\Repositories\Interfaces\ProductInterface; use Botble\Support\Repositories\Caches\CacheAbstractDecorator; class ProductCacheDecorator extends CacheAbstractDecorator implements ProductInterface { /** * {@inheritDoc} */ public function getSearch($query, $paginate = 10) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function syncCategories($model, $categories = null) { $result = call_user_func_array([$this->repository, __FUNCTION__], func_get_args()); if (is_array($result) && isset($result['error']) && !$result['error']) { $this->cache->flush(); /** * @var ProductCategoryCacheDecorator $categoryRepository */ $categoryRepository = app(ProductCategoryInterface::class); $categoryRepository->getCacheInstance()->flush(); } return $result; } /** * {@inheritDoc} */ public function getRelatedCategories($model) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getRelatedCategoryIds($model) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function syncProductCollections($model, $productCollections = null) { $result = call_user_func_array([$this->repository, __FUNCTION__], func_get_args()); if (is_array($result) && isset($result['error']) && !$result['error']) { $this->getCacheInstance()->flushCache(); /** * @var ProductCollectionCacheDecorator $productCollectionRepository */ $productCollectionRepository = app(ProductCollectionInterface::class); $productCollectionRepository->getCacheInstance()->flushCache(); } return $result; } /** * {@inheritDoc} */ public function getRelatedProductCollections($model) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getRelatedProductCollectionIds($model) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function syncProducts($model, $products = null) { $result = call_user_func_array([$this->repository, __FUNCTION__], func_get_args()); if (is_array($result) && isset($result['error']) && !$result['error']) { $this->getCacheInstance()->flushCache(); /** * @var ProductCacheDecorator $productCollectionRepository */ $productRepository = app(ProductInterface::class); $productRepository->getCacheInstance()->flushCache(); } return $result; } /** * {@inheritDoc} */ public function getRelatedProducts($model) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getRelatedProductIds($model) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function syncCrossSaleProducts($model, $products = null) { $result = call_user_func_array([$this->repository, __FUNCTION__], func_get_args()); if (is_array($result) && isset($result['error']) && !$result['error']) { $this->getCacheInstance()->flushCache(); /** * @var ProductCacheDecorator $productCollectionRepository */ $productRepository = app(ProductInterface::class); $productRepository->getCacheInstance()->flushCache(); } return $result; } /** * {@inheritDoc} */ public function syncUpSaleProducts($model, $products = null) { $result = call_user_func_array([$this->repository, __FUNCTION__], func_get_args()); if (is_array($result) && isset($result['error']) && !$result['error']) { $this->getCacheInstance()->flushCache(); /** * @var ProductCacheDecorator $productCollectionRepository */ $productRepository = app(ProductInterface::class); $productRepository->getCacheInstance()->flushCache(); } return $result; } /** * {@inheritDoc} */ public function getRelatedProductAttributeSets($product) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getRelatedProductAttributeSetIds($product) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getRelatedProductAttributes($product) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getRelatedProductAttributeIds($product) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getProducts(array $params) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getProductsWithCategory(array $params) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getOnSaleProducts(array $params) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getProductVariations($configurableProductId, array $params = []) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getProductsByCollections(array $params) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getProductByBrands(array $params) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getProductByTags(array $params) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function filterProducts(array $filters, array $params = []) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } /** * {@inheritDoc} */ public function getProductsByCategories(array $params) { return $this->getDataIfExistCache(__FUNCTION__, func_get_args()); } }
[-] ProductAttributeSetCacheDecorator.php
[edit]
[-] BrandCacheDecorator.php
[edit]
[-] ProductCategoryCacheDecorator.php
[edit]
[-] TaxCacheDecorator.php
[edit]
[+]
..
[-] AddressCacheDecorator.php
[edit]
[-] ShipmentHistoryCacheDecorator.php
[edit]
[-] WishlistCacheDecorator.php
[edit]
[-] ProductTagCacheDecorator.php
[edit]
[-] ShippingRuleItemCacheDecorator.php
[edit]
[-] CustomerCacheDecorator.php
[edit]
[-] ShippingRuleCacheDecorator.php
[edit]
[-] FlashSaleCacheDecorator.php
[edit]
[-] ProductVariationCacheDecorator.php
[edit]
[-] ProductCacheDecorator.php
[edit]
[-] ShipmentCacheDecorator.php
[edit]
[-] ProductCollectionCacheDecorator.php
[edit]
[-] GroupedProductCacheDecorator.php
[edit]
[-] CurrencyCacheDecorator.php
[edit]
[-] ShippingCacheDecorator.php
[edit]
[-] ProductLabelCacheDecorator.php
[edit]
[-] OrderProductCacheDecorator.php
[edit]
[-] OrderAddressCacheDecorator.php
[edit]
[-] DiscountCacheDecorator.php
[edit]
[-] OrderHistoryCacheDecorator.php
[edit]
[-] ProductVariationItemCacheDecorator.php
[edit]
[-] ProductAttributeCacheDecorator.php
[edit]
[-] ReviewCacheDecorator.php
[edit]
[-] OrderCacheDecorator.php
[edit]
[-] StoreLocatorCacheDecorator.php
[edit]