src/Silvestra/Component/Banner/BannerZoneSynchronizer.php
public function synchronize($locale)
    {
        $existingSystemZones = $this->manager->findSystemSlugs();

        $newZones = array();
        foreach ($this->registry->getConfigs() as $config) {
            if (false === in_array($config->getSlug(), $existingSystemZones)) {
                $newZones[] = $this->createZone($config);
            }
        }

        if (0 < count($newZones)) {
            $this->manager->save();

            foreach ($newZones as $zone) {
                $this->eventDispatcher->dispatch(BannerZoneEvents::CREATE, new BannerZoneEvent($zone, $locale));
            }
        }
    }
public function synchronize($locale)
    {
        $existingSystemZones = $this->manager->findSystemSlugs();

        $newZones = array();
        foreach ($this->registry->getConfigs() as $config) {
            if (false === in_array($config->getSlug(), $existingSystemZones)) {
                $newZones[] = $this->createZone($config);
            }
        }

        if (0 < count($newZones)) {
            $this->manager->save();

            foreach ($newZones as $zone) {
                $this->eventDispatcher->dispatch(BannerZoneEvents::CREATE, new BannerZoneEvent($zone, $locale));
            }
        }
    }
public function synchronize ( $ locale ) { $ existingSystemZones = $ this -> manager -> findSystemSlugs ( ) ; $ newZones = array ( ) ; foreach ( $ this -> registry -> getConfigs ( ) as $ config ) { if ( false === in_array ( $ config -> getSlug ( ) , $ existingSystemZones ) ) { $ newZones [ ] = $ this -> createZone ( $ config ) ; } } if ( 0 < count ( $ newZones ) ) { $ this -> manager -> save ( ) ; foreach ( $ newZones as $ zone ) { $ this -> eventDispatcher -> dispatch ( BannerZoneEvents :: CREATE , new BannerZoneEvent ( $ zone , $ locale ) ) ; } } }
Synchronize system banner zones.

@param string $locale
Synchronize system banner zones .