Example #1
0
 /**
  * Warms up the configuration data cache.
  *
  * @param int $mode One of MODE_* constant
  */
 public function warmUpCache($mode = self::MODE_ALL)
 {
     if (!$this->configManager->isDatabaseReadyToWork()) {
         return;
     }
     $this->loadConfigurable($mode === self::MODE_CONFIGURABLE_ENTITY_ONLY);
     if ($mode === self::MODE_ALL) {
         // disallow to load new models
         $this->configModelLockObject->lock();
         try {
             $this->loadNonConfigurable();
             $this->loadVirtualFields();
             $this->configModelLockObject->unlock();
         } catch (\Exception $e) {
             $this->configModelLockObject->unlock();
             throw $e;
         }
     }
 }