Inheritance: extends Symfony\Component\EventDispatcher\Event
 public function onConfigScopeChange(ScopeChangeEvent $event)
 {
     $siteAccess = $event->getSiteAccess();
     $this->configResolver->setDefaultScope($siteAccess->name);
     if ($this->viewManager instanceof SiteAccessAware) {
         $this->viewManager->setSiteAccess($siteAccess);
     }
 }
Ejemplo n.º 2
0
 public function onConfigScopeChange(ScopeChangeEvent $event)
 {
     $siteAccess = $event->getSiteAccess();
     $this->configResolver->setDefaultScope($siteAccess->name);
     if ($this->viewManager instanceof SiteAccessAware) {
         $this->viewManager->setSiteAccess($siteAccess);
     }
     // Ensure to reset services that need to be.
     foreach ($this->resettableServiceIds as $serviceId) {
         $this->container->set($serviceId, null);
     }
     // Force dynamic settings services to synchronize.
     // This will trigger services depending on dynamic settings to update if they use setter injection.
     foreach ($this->dynamicSettingsServiceIds as $fakeServiceId) {
         $this->container->set($fakeServiceId, null);
         $this->container->set($fakeServiceId, $this->container->get($fakeServiceId));
     }
 }
 public function testGetSiteAccess()
 {
     $siteAccess = new SiteAccess('foo', 'test');
     $event = new ScopeChangeEvent($siteAccess);
     $this->assertSame($siteAccess, $event->getSiteAccess());
 }