/**
  * Transforms Tracker_Renderer into a SimpleXMLElement
  * 
  * @param SimpleXMLElement $root the node to which the renderer is attached (passed by reference)
  */
 public function exportToXml(SimpleXMLElement $root, $formsMapping)
 {
     parent::exportToXML($root, $formsMapping);
     $child = $root->addChild('charts');
     foreach ($this->getChartFactory()->getCharts($this) as $chart) {
         $grandchild = $child->addChild('chart');
         $chart->exportToXML($grandchild, $formsMapping);
     }
 }
 /**
  * Transforms Tracker_Renderer into a SimpleXMLElement
  * 
  * @param SimpleXMLElement $root the node to which the renderer is attached (passed by reference)
  * @param $formsMapping the form elements mapping
  */
 public function exportToXml(SimpleXMLElement $root, $formsMapping)
 {
     parent::exportToXML($root, $formsMapping);
     if ($mapping = (string) array_search($this->field_id, $formsMapping)) {
         $root->addAttribute('field_id', $mapping);
     }
 }
 /**
  * Transforms Tracker_Renderer into a SimpleXMLElement
  * 
  * @param SimpleXMLElement $root the node to which the renderer is attached (passed by reference)
  */
 public function exportToXml(SimpleXMLElement $root, $xmlMapping)
 {
     parent::exportToXML($root, $xmlMapping);
     $root->addAttribute('chunksz', $this->chunksz);
     if ($this->multisort) {
         $root->addAttribute('multisort', $this->multisort);
     }
     $child = $root->addChild('columns');
     foreach ($this->getColumns() as $key => $col) {
         $child->addChild('field')->addAttribute('REF', array_search($key, $xmlMapping));
     }
     //TODO : add aggregates in XML export
     /*if ($this->getAggregates()) {
           $child = $root->addChild('aggregates');
           foreach ($this->getAggregates() as $field_id => $aggregates) {
               foreach ($aggregates as $aggregate) {
                   $child->addChild('aggregate')->addAttribute('REF', array_search($field_id, $xmlMapping))
                                                ->addAttribute('function', $aggregate);
               }
           }
       }*/
     if ($this->getSort()) {
         $child = $root->addChild('sort');
         foreach ($this->getSort() as $key => $sort) {
             $child->addChild('field')->addAttribute('REF', array_search($key, $xmlMapping));
         }
     }
 }