예제 #1
0
파일: View.php 프로젝트: global01/victoire
 /**
  * Method called once the entity is loaded.
  *
  * @ORM\PostLoad
  */
 public function postLoad()
 {
     $widgetMap = $this->widgetMap;
     //the slots of the page
     $slots = [];
     //convert the widget map array as objects
     foreach ($widgetMap as $slotId => $_widgetMapEntries) {
         $slot = new Slot();
         $slot->setId($slotId);
         foreach ($_widgetMapEntries as $_widgetMapEntry) {
             $_widgetMap = new WidgetMap();
             $_widgetMap->setAction(@$_widgetMapEntry['action']);
             $_widgetMap->setPosition(@$_widgetMapEntry['position']);
             $_widgetMap->setPositionReference(@$_widgetMapEntry['positionReference']);
             $_widgetMap->setAsynchronous(isset($_widgetMapEntry['asynchronous']) ? $_widgetMapEntry['asynchronous'] : null);
             $_widgetMap->setReplacedWidgetId(@$_widgetMapEntry['replacedWidgetId']);
             $_widgetMap->setWidgetId(intval($_widgetMapEntry['widgetId']));
             $slot->addWidgetMap($_widgetMap);
         }
         $slots[] = $slot;
     }
     //set the slots to the page
     $this->slots = $slots;
 }