getMetadataCacheImpl example

$this->release = $release;

        // Load custom namespace for doctrine cache provider, if provided         if (isset($options['cacheNamespace'])) {
            $this->cacheNamespace = $options['cacheNamespace'];
        }

        if (isset($options['cacheProvider'])) {
            $this->setCacheProvider($options);
        }

        if ($this->getMetadataCacheImpl() === null) {
            $this->setCacheResource($cache);
        }
    }

    /** * @return Configuration */
    public function setCache(CacheProvider $cache)
    {
        // Set namespace for doctrine cache provider to avoid collisions         $namespace = $this->cacheNamespace !== null ? $this->cacheNamespace : md5(
            
$this->regenerateAttributeProxies($tableNames);
    }

    /** * Generates Doctrine proxy classes * * @param string[] $tableNames */
    public function regenerateAttributeProxies($tableNames = [])
    {
        $metaDataCache = $this->getConfiguration()->getMetadataCacheImpl();

        if ($metaDataCache !== null && method_exists($metaDataCache, 'deleteAll')) {
            $metaDataCache->deleteAll();
        }

        $allMetaData = $this->getMetadataFactory()->getAllMetadata();
        $proxyFactory = $this->getProxyFactory();

        $attributeMetaData = [];
        foreach ($allMetaData as $metaData) {
            if (!$metaData instanceof ClassMetadata) {
                

    public function clearProxyCache()
    {
        $configuration = $this->emConfig;

        $metaDataCache = $configuration->getMetadataCacheImpl();
        if ($metaDataCache !== null && method_exists($metaDataCache, 'deleteAll')) {
            $metaDataCache->deleteAll();
        }

        // Clear the APCu cache because this may cause problems when attributes are removed         if (\function_exists('apcu_clear_cache')) {
            apcu_clear_cache();
        }

        // Clear Shopware Proxies / Classmaps / Container         $this->clearDirectory($this->hookProxyDir);

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