Пример #1
0
 /**
  * Processes output files for one Store Group. Each store that has a
  * non-empty SiteId and is enabled gets a feed output. File name
  * is StoreId.csv and it's placed in the configured feed file path.
  * @param $stores array of Mage_Core_Model_Store(s) to process
  * @return self
  */
 protected function _processStores(array $stores)
 {
     foreach ($stores as $store) {
         $storeId = $store->getId();
         $siteId = $this->_config->getSiteId($storeId);
         if (empty($siteId) || !$this->_config->getIsEnabled($storeId)) {
             // If this store doesn't have a site id, or isn't enabled for Display, skip it
             continue;
         }
         try {
             $this->_adapter->openCsvFile($this->_getCsvFile($storeId));
         } catch (EbayEnterprise_Display_Model_File_Exception $e) {
             // If we can't open the output file, complain to log and skip this store
             Mage::log($e->getMessage());
             continue;
         }
         $this->_adapter->addNewCsvRow($this->_config->getFeedHeaderColumns());
         $this->_writeDataRows($storeId);
         $this->_adapter->closeCsvFile();
     }
     return $this;
 }