コード例 #1
0
 protected function getEvent($handle = 'default')
 {
     $event = new UpdateEvent();
     $event->setHandles([$handle]);
     $event->setLayoutStructure($this->layoutStructure);
     return $event;
 }
コード例 #2
0
 /**
  *
  * @param UpdateEvent $event
  */
 public function fetch(UpdateEvent $event)
 {
     $handles = $event->getHandles();
     if ($area = $event->getArea()) {
         $this->setArea($area);
     }
     $this->layoutStructure = $event->getLayoutStructure();
     foreach ($handles as $handle) {
         $this->fetchHandle($handle);
     }
 }
コード例 #3
0
ファイル: LayoutUpdater.php プロジェクト: hummer2k/conlayout
 /**
  *
  * @return Config
  */
 public function getLayoutStructure()
 {
     if (null === $this->layoutStructure) {
         $this->layoutStructure = new Config([], true);
         $handles = $this->getHandles();
         $event = new UpdateEvent();
         $event->setLayoutStructure($this->layoutStructure);
         $event->setHandles($handles);
         $event->setArea($this->getArea());
         $event->setName(UpdateEvent::EVENT_COLLECT);
         $event->setTarget($this);
         $results = $this->getEventManager()->triggerEventUntil(function ($result) {
             return $result instanceof Config;
         }, $event);
         if ($results->stopped()) {
             $this->layoutStructure = $results->last();
         } else {
             $this->fetchUpdates();
             $event->setName(UpdateEvent::EVENT_COLLECT_POST);
             $this->getEventManager()->triggerEvent($event);
         }
         $this->layoutStructure->setReadOnly();
     }
     return $this->layoutStructure;
 }
コード例 #4
0
ファイル: LayoutUpdater.php プロジェクト: adamdyson/ConLayout
 /**
  *
  * @return Config
  */
 public function getLayoutStructure()
 {
     if (null === $this->layoutStructure) {
         $this->layoutStructure = new Config([], true);
         $handles = $this->getHandles();
         $event = new UpdateEvent();
         $event->setLayoutStructure($this->layoutStructure);
         $event->setHandles($handles);
         $event->setArea($this->getArea());
         $results = $this->getEventManager()->trigger(__FUNCTION__ . '.pre', $this, $event, function ($result) {
             return $result instanceof Config;
         });
         if ($results->stopped()) {
             $this->layoutStructure = $results->last();
         } else {
             $this->getEventManager()->trigger(__FUNCTION__ . '.post', $this, $event);
         }
         $this->layoutStructure->setReadOnly();
     }
     return $this->layoutStructure;
 }