Ejemplo n.º 1
0
 /**
  * Removes all entries from all used caches, completely.
  */
 public function flushAllCaches()
 {
     //$this->cache->flushAllConfigurable();
     //$this->cache->flushAllConfigs();
     // @todo temporary solution. 'flush' methods should be used. should be fixed in BAP-9151
     $this->cache->deleteAllConfigurable();
     $this->cache->deleteAllConfigs();
 }
Ejemplo n.º 2
0
 /**
  * Clears entity config cache
  *
  * @param ConfigIdInterface|null $configId
  */
 public function clearCache(ConfigIdInterface $configId = null)
 {
     if ($configId) {
         $this->cache->deleteConfig($configId);
     } else {
         $this->cache->deleteAllConfigs();
     }
 }
Ejemplo n.º 3
0
 public function testDeleteAllConfigsLocalCacheOnly()
 {
     $config = new Config(new EntityConfigId(self::SCOPE, self::ENTITY_CLASS), ['key1' => 'val1']);
     $this->configCache->saveConfig($config, true);
     $this->cache->expects($this->never())->method('deleteAll');
     $this->assertTrue($this->configCache->deleteAllConfigs(true));
     // check that a local cache is cleaned up
     $this->assertNull($this->configCache->getEntityConfig(self::SCOPE, self::ENTITY_CLASS, true));
 }
Ejemplo n.º 4
0
 /**
  * Clears entity config cache
  *
  * @param ConfigIdInterface|null $configId
  */
 public function clearCache(ConfigIdInterface $configId = null)
 {
     if ($configId) {
         if ($configId instanceof FieldConfigId) {
             $this->cache->deleteFieldConfig($configId->getClassName(), $configId->getFieldName());
         } else {
             $this->cache->deleteEntityConfig($configId->getClassName());
         }
     } else {
         $this->cache->deleteAllConfigs();
     }
 }
Ejemplo n.º 5
0
 public function testDeleteAllConfigs()
 {
     $this->cache->expects($this->once())->method('deleteAll')->willReturn(true);
     $this->assertTrue($this->configCache->deleteAllConfigs());
 }