コード例 #1
0
 /**
  * given a sourceFile and a self::_configMap give move the file
  * to any destination the key is map to after successful file move
  * try removing the source file
  * @param string
  * @param string
  * @return self
  */
 protected function _mvTo($sourceFile, $cfgKey)
 {
     $destination = $this->_buildPath($cfgKey) . DS . basename($sourceFile);
     $isDeletable = true;
     try {
         $this->_coreHelper->moveFile($sourceFile, $destination);
     } catch (EbayEnterprise_Catalog_Exception_Feed_File $e) {
         $isDeletable = false;
         $this->_logger->error($e->getMessage(), $this->_context->getMetaData(__CLASS__, [], $e));
     }
     if ($isDeletable) {
         try {
             $this->_coreHelper->removeFile($sourceFile);
         } catch (EbayEnterprise_Catalog_Exception_Feed_File $e) {
             $this->_logger->error($e->getMessage(), $this->_context->getMetaData(__CLASS__, [], $e));
         }
     }
     return $this;
 }