OXID eShop CE  4.9.10
 All Classes Files Functions Variables Pages
oxErpGenImport Class Reference
+ Inheritance diagram for oxErpGenImport:
+ Collaboration diagram for oxErpGenImport:

Public Member Functions

 __call ($sMethod, $aArgs)
 __construct ()
 getInstanceOfType ($sType)
 getImportObject ($sType)
 setImportTypePrefix ($sType)
 getImportObjectsList ()
 init ($sUserName, $sPassword, $iShopID=1, $iLanguage=0)
 setCsvFileFieldsOrder ($aCsvFields)
 setCsvContainsHeader ($blCsvContainsHeader)
 getTotalImportedRowsNumber ()
 doImport ($sPath=null, $sUserName=null, $sUserPassword=null, $sShopId=null, $sShopLanguage=null)
- Public Member Functions inherited from oxErpCsv
 loadSessionData ($sSessionID)
 import ()
 getImportData ($iIdx=null)
 getImportedRowCount ()
 setImportedIds ($key)
- Public Member Functions inherited from oxERPBase
 getStatistics ()
 getSessionID ()
 exportType ($sType, $sWhere=null, $iStart=null, $iCount=null, $sSortFieldName=null, $sSortType=null)
 createPluginObject ($sId)

Protected Member Functions

 _setDbLayerVersion ()
 _modifyData ($aData, $oType)
 _mapFields ($aData, $oType)
 _getImportType (&$aData)
 _getImportMode ($aData)
 _getCsvFieldsTerminator ()
 _getCsvFieldsEncolser ()
- Protected Member Functions inherited from oxErpCsv
 _beforeExport ($sType)
 _afterExport ($sType)
 _csvTextConvert ($sText, $blMode)
 _beforeImport ()
 _afterImport ()
 _checkIDField ($sID)
 _getInstanceOfType ($sType)
 _importArticle (oxERPType $oType, $aRow)
 _importAccessoire (oxERPType $oType, $aRow)
 _importArticle2Action (oxERPType $oType, $aRow)
 _importArticle2Category (oxERPType $oType, $aRow)
 _importMainArticle2Category (oxERPType $oType, $aRow)
 _importCategory (oxERPType $oType, $aRow)
 _importCrossselling (oxERPType $oType, $aRow)
 _importScaleprice (oxERPType $oType, $aRow)
 _importOrder (oxERPType $oType, $aRow)
 _importOrderArticle (oxERPType $oType, $aRow)
 _importOrderStatus (oxERPType $oType, $aRow)
 _importUser (oxERPType $oType, $aRow)
 _importVendor (oxERPType $oType, $aRow)
 _importArtextends (oxERPType $oType, $aRow)
 _importCountry (oxERPType $oType, $aRow)
 _importArticleStock (oxERPType $oType, $aRow)
- Protected Member Functions inherited from oxERPBase
 _export ($sType, $sWhere, $iStart=null, $iCount=null, $sSortFieldName=null, $sSortType=null)
 _outputMappingArray ($sTable)
 _getKeyID ($oType, $aData)
 _resetIdx ()
 _nextIdx ()
 _checkAccess ($oType, $blWrite, $sOxid=null)
 _importOne ()
 _save (oxERPType &$oType, $aData, $blAllowCustomShopId=false)

Protected Attributes

 $_aObjects
 $_aCsvFileFieldsOrder = array()
 $_blCsvContainsHeader = null
 $_sDefaultStringTerminator = ";"
 $_sDefaultStringEncloser = '"'
- Protected Attributes inherited from oxErpCsv
 $_aSupportedVersions = array("0.1", "1.0", "1.1", "2.0")
 $_aCsv2BaseVersionsMap = array("0.1" => "1", "1.0" => "1", "1.1" => "1.1", "2.0" => "2")
 $_sCurrVersion = ""
 $_aData = array()
 $_iRetryRows = 0
 $_sReturn
 $_sPath
 $_aImportedActions2Article = array()
 $_aImportedObject2Category = array()
 $_aImportedAccessoire2Article = array()
- Protected Attributes inherited from oxERPBase
 $_blInit = false
 $_iLanguage = null
 $_sUserID = null
 $_sSID = null
 $_aImportedIds = array()
 $_iImportedRowCount = 0

Additional Inherited Members

- Static Public Member Functions inherited from oxERPBase
static getRequestedVersion ()
static getUsedDbFieldsVersion ()
static setVersion ($sDbLayerVersion= '')
- Public Attributes inherited from oxERPBase
const ERROR_USER_WRONG = "ERROR: Could not login"
const ERROR_USER_NO_RIGHTS = "Not sufficient rights to perform operation!"
const ERROR_USER_EXISTS = "ERROR: User already exists"
const ERROR_NO_INIT = "Init not executed, Access denied!"
const ERROR_DELETE_NO_EMPTY_CATEGORY = "Only empty category can be deleated"
const ERROR_OBJECT_NOT_EXISTING = "Object does not exist"
const ERROR_ERP_VERSION_NOT_SUPPORTED_BY_SHOP = "ERROR: shop does not support requested ERP version."
const ERROR_SHOP_VERSION_NOT_SUPPORTED_BY_ERP = "ERROR: ERP does not support current shop version."
 $_aStatistics = array()
 $_iIdx = 0
- Static Public Attributes inherited from oxERPBase
static $MODE_IMPORT = "Import"
static $MODE_DELETE = "Delete"
- Static Protected Member Functions inherited from oxERPBase
static _checkShopVersion ()
static _checkRequestedVersion ()
- Static Protected Attributes inherited from oxERPBase
static $_sRequestedVersion = ''
static $_aDbLayer2ShopDbVersions

Detailed Description

Class handeling csv import

Definition at line 7 of file oxerpgenimport.php.

Constructor & Destructor Documentation

oxErpGenImport::__construct ( )

Class constructor.

Returns
null

Definition at line 88 of file oxerpgenimport.php.

Member Function Documentation

oxErpGenImport::__call (   $sMethod,
  $aArgs 
)

Only used for convenience in UNIT tests by doing so we avoid writing extended classes for testing protected or private methods

Parameters
string$sMethodMethods name
array$aArgsArgument array
Exceptions
oxSystemComponentExceptionThrows an exception if the called method does not exist or is not accessable in current class
Returns
string

Reimplemented from oxERPBase.

Definition at line 69 of file oxerpgenimport.php.

oxErpGenImport::_getCsvFieldsEncolser ( )
protected

Get csv field encloser symbol

Returns
string

Definition at line 385 of file oxerpgenimport.php.

oxErpGenImport::_getCsvFieldsTerminator ( )
protected

Set csv field terminator symbol

Returns
string

Definition at line 364 of file oxerpgenimport.php.

oxErpGenImport::_getImportMode (   $aData)
protected

Gets import mode

Parameters
array$aDataCSV data
Returns
string

Reimplemented from oxErpCsv.

Definition at line 185 of file oxerpgenimport.php.

oxErpGenImport::_getImportType ( $aData)
protected

Gets import object type according type prefix

Parameters
array&$aDataCSV data
Exceptions
Exeptionif no such import type prefix
Returns
string

Reimplemented from oxErpCsv.

Definition at line 167 of file oxerpgenimport.php.

oxErpGenImport::_mapFields (   $aData,
  $oType 
)
protected

Maps numeric array to assoc. Array

Parameters
array$aDatanumeric indices
object$oTypeobject type
Returns
array assoc. indices

Definition at line 139 of file oxerpgenimport.php.

oxErpGenImport::_modifyData (   $aData,
  $oType 
)
protected

Modyfies data befor import. Calls method for object fields and csv data mapping.

Parameters
array$aDataCSV data
object$oTypeobject type
Returns
array

Reimplemented from oxErpCsv.

Definition at line 126 of file oxerpgenimport.php.

oxErpGenImport::_setDbLayerVersion ( )
protected

Setting DB layer version to latest

Definition at line 110 of file oxerpgenimport.php.

oxErpGenImport::doImport (   $sPath = null,
  $sUserName = null,
  $sUserPassword = null,
  $sShopId = null,
  $sShopLanguage = null 
)

Main import method, whole import of all types via a given csv file is done here

Parameters
string$sPathfull path of the CSV file.
string$sUserNameuser name
string$sUserPasswordpassword
integer$sShopIdshop ID
integer$sShopLanguagelanguage ID
Returns
string

Definition at line 310 of file oxerpgenimport.php.

oxErpGenImport::getImportObject (   $sType)

Get imort object according import type

Parameters
string$sTypeimport object type
Returns
object

Definition at line 197 of file oxerpgenimport.php.

oxErpGenImport::getImportObjectsList ( )

Get allowed for import objects list

Returns
array

Definition at line 223 of file oxerpgenimport.php.

oxErpGenImport::getInstanceOfType (   $sType)

Get instance of type

Parameters
string$sTypeinstance type
Exceptions
Exeptiontype not supported
Returns
object

Definition at line 102 of file oxerpgenimport.php.

oxErpGenImport::getTotalImportedRowsNumber ( )

Get successfully imported rows number

Returns
int

Definition at line 293 of file oxerpgenimport.php.

oxErpGenImport::init (   $sUserName,
  $sPassword,
  $iShopID = 1,
  $iLanguage = 0 
)

Init ERP Framework parameters Creates Objects, checks Rights etc.

Parameters
mixed$sUserNameuser name
mixed$sPasswordpassword
integer$iShopIDshop ID
integer$iLanguagelanguage ID
Returns
boolean

Reimplemented from oxERPBase.

Definition at line 244 of file oxerpgenimport.php.

oxErpGenImport::setCsvContainsHeader (   $blCsvContainsHeader)

Set if CSV file contains header row

Parameters
bool$blCsvContainsHeaderhas or not file header

Definition at line 283 of file oxerpgenimport.php.

oxErpGenImport::setCsvFileFieldsOrder (   $aCsvFields)

Set CSV file comumns names

Parameters
array$aCsvFieldsCSV fields

Definition at line 273 of file oxerpgenimport.php.

oxErpGenImport::setImportTypePrefix (   $sType)

Set import object type prefix

Parameters
string$sTypeimport type prefix

Definition at line 213 of file oxerpgenimport.php.

Member Data Documentation

oxErpGenImport::$_aCsvFileFieldsOrder = array()
protected

Definition at line 35 of file oxerpgenimport.php.

oxErpGenImport::$_aObjects
protected
Initial value:
array(
'A' => 'article',
'K' => 'category',
'H' => 'vendor',
'C' => 'crossselling',
'Z' => 'accessoire',
'T' => 'article2category',
'I' => 'article2action',
'P' => 'scaleprice',
'U' => 'user',
'O' => 'order',
'R' => 'orderarticle',
'N' => 'country',
'Y' => 'artextends',
)

Definition at line 15 of file oxerpgenimport.php.

oxErpGenImport::$_blCsvContainsHeader = null
protected

Definition at line 42 of file oxerpgenimport.php.

oxErpGenImport::$_sDefaultStringEncloser = '"'
protected

Definition at line 56 of file oxerpgenimport.php.

oxErpGenImport::$_sDefaultStringTerminator = ";"
protected

Definition at line 49 of file oxerpgenimport.php.


The documentation for this class was generated from the following file: