public function getStack(GetObjectStackEvent $event)
    {
        $stack = array();
        $value = $event->getValue();

        if ($value instanceof Map) {
            foreach ($value->getControls() as $control) {
                if ($control instanceof Layers) {
                    $this->addLayersToStack($control->getBaseLayers(), $stack);
                    $this->addLayersToStack($control->getOverlays(), $stack);
                }

                $stack[] = $control;
            }

            $this->addLayersToStack($value->getLayers(), $stack);

            $event->setStack($stack);
        }
    }
public function getStack(GetObjectStackEvent $event)
    {
        $stack = array();
        $value = $event->getValue();

        if ($value instanceof Map) {
            foreach ($value->getControls() as $control) {
                if ($control instanceof Layers) {
                    $this->addLayersToStack($control->getBaseLayers(), $stack);
                    $this->addLayersToStack($control->getOverlays(), $stack);
                }

                $stack[] = $control;
            }

            $this->addLayersToStack($value->getLayers(), $stack);

            $event->setStack($stack);
        }
    }
public function getStack ( GetObjectStackEvent $ event ) { $ stack = array ( ) ; $ value = $ event -> getValue ( ) ; if ( $ value instanceof Map ) { foreach ( $ value -> getControls ( ) as $ control ) { if ( $ control instanceof Layers ) { $ this -> addLayersToStack ( $ control -> getBaseLayers ( ) , $ stack ) ; $ this -> addLayersToStack ( $ control -> getOverlays ( ) , $ stack ) ; } $ stack [ ] = $ control ; } $ this -> addLayersToStack ( $ value -> getLayers ( ) , $ stack ) ; $ event -> setStack ( $ stack ) ; } }
Get object stack of the map as far as possible.

@param GetObjectStackEvent $event The subscribed event.

@return void
Get object stack of the map as far as possible .