buildCacheKey example


    private $cache;

    public function __construct(ConfigurationLayerInterface $lastLayer, Zend_Cache_Core $cache)
    {
        $this->layer = $lastLayer;
        $this->cache = $cache;
    }

    public function getByPluginName(string $pluginName, ?int $shopId = null): array
    {
        $cacheKey = $this->buildCacheKey($pluginName$shopId);

        if ($this->cache->test($cacheKey) !== false) {
            $cacheResult = $this->cache->load($cacheKey, true);

            if (\is_array($cacheResult)) {
                return $cacheResult;
            }
        }

        $readValues = $this->layer->readValues($pluginName$shopId);

        
Home | Imprint | This part of the site doesn't use cookies.