Example #1
0
 /**
  * @param ConfigUpdateEvent $event
  */
 public function onConfigUpdate(ConfigUpdateEvent $event)
 {
     if (!$event->isChanged('oro_locale.timezone')) {
         return;
     }
     $this->metricStateManager->resetMetrics();
     $this->metricStateManager->scheduleRecalculation();
 }
 /**
  * @param ConfigUpdateEvent $event
  */
 public function onConfigUpdate(ConfigUpdateEvent $event)
 {
     if (!$event->isChanged('oro_locale.language')) {
         return;
     }
     // mark translation cache dirty
     $this->dbTranslationMetadataCache->updateTimestamp($event->getNewValue('oro_locale.language'));
 }
 /**
  * @dataProvider valueRetrievingDataProvider
  *
  * @param string $key
  * @param array  $expectedValues
  * @param bool   $exception
  *
  */
 public function testValueRetrieving($key, array $expectedValues, $exception = false)
 {
     if (false !== $exception) {
         $this->setExpectedException($exception);
     }
     $new = $this->event->getNewValue($key);
     $old = $this->event->getOldValue($key);
     $this->assertEquals($expectedValues['old'], $old);
     $this->assertEquals($expectedValues['new'], $new);
 }
Example #4
0
 /**
  * @param ConfigUpdateEvent $event
  */
 public function onUpdateAfter(ConfigUpdateEvent $event)
 {
     $changedData = array();
     foreach ($this->keys as $key) {
         $configKey = $this->getKeyName($key);
         if ($event->isChanged($configKey)) {
             $changedData[$key] = $event->getNewValue($configKey);
         }
     }
     if ($changedData) {
         $this->updateTrackingConfig($changedData);
     }
 }
Example #5
0
 /**
  * @param ConfigUpdateEvent $event
  */
 public function onConfigUpdate(ConfigUpdateEvent $event)
 {
     if (!$event->isChanged('oro_locale.timezone')) {
         return;
     }
     if (!$this->isAlreadyScheduled()) {
         /** @var EntityManager $em */
         $em = $this->registry->getManager();
         $job = new Job(LifetimeAverageAggregateCommand::COMMAND_NAME, ['-f']);
         $em->persist($job);
         $em->flush($job);
     }
 }