getCollection()->getData(); if(!count($tabs)) return false; foreach($tabs as $tab) { $data[] = $this->getStandData($tab); } // var_dump($data);die(); $csv = ''; $csv .= $this->_fieldstr ."\n"; foreach($data as $row) { $rowstr = implode('","',$row); $rowstr = '"'.$rowstr.'"'; $csv .= $rowstr."\n"; } return $csv; } public function getXmlTabs() { $tabs = Mage::getModel('producttab/tab')->getCollection(); if(!count($tabs)) return false; $tabM = Mage::getModel('producttab/tab'); foreach($tabs as $tab) { $data = $this->getStandDataXML($tab); $tab->setData($data); $tabcollection[] = $tab; } //var_dump($tabM); $xml = ''; $xml.= ''; foreach ($tabcollection as $item) { $xml.= $item->toXml(); } $xml.= ''; return $xml; } public function getStandDataXML($tab) { $qd = $tab->getData('arw_tab_id'); $TabL=Mage::getModel('producttab/tab')->load($qd); $data = $TabL->getData(); $StoreIdStr=implode(",",$data['store_id']); $data['store_id']=$StoreIdStr; $fields = $this->_getFields(); $export_data = array(); foreach($fields as $field) { $value = isset($data[$field]) ? $data[$field] : ''; $export_data[$field] = $value; } return $export_data; } public function getStandData($tab) { $TabL=Mage::getModel('producttab/tab')->load($tab['arw_tab_id']); $data = $TabL->getData(); $StoreIdStr=implode(",",$data['store_id']); $data['store_id']=$StoreIdStr; $fields = $this->_getFields(); $export_data = array(); foreach($fields as $field) { $value = isset($data[$field]) ? $data[$field] : ''; $export_data[$field] = $value; } return $export_data; } protected function _getFields() { if(! $this->getData('fields')) { $fields = explode(',',$this->_fieldstr); $this->setData('fields',$fields); } return $this->getData('fields'); } }