oxErpGenImport Class Reference

Inheritance diagram for oxErpGenImport:

Inheritance graph
[legend]
Collaboration diagram for oxErpGenImport:

Collaboration graph
[legend]

List of all members.


Detailed Description

Class handeling csv import

Definition at line 7 of file oxerpgenimport.php.


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)

Protected Member Functions

 _setDbLayerVersion ()
 _modifyData ($aData, $oType)
 _mapFields ($aData, $oType)
 _getImportType (&$aData)
 _getImportMode ($aData)

Protected Attributes

 $_aObjects
 $_aCsvFileFieldsOrder = array()
 $_blCsvContainsHeader = null

Constructor & Destructor Documentation

oxErpGenImport.__construct (  ) 

Class constructor.

Returns:
null

Definition at line 74 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 $sMethod Methods name
array $aArgs Argument array
Exceptions:
oxSystemComponentException Throws an exception if the called method does not exist or is not accessable in current class
Returns:
string

Reimplemented from oxERPBase.

Definition at line 55 of file oxerpgenimport.php.

oxErpGenImport.getInstanceOfType ( sType  ) 

Get instance of type

Parameters:
string $sType instance type
Exceptions:
Exeption type not supported
Returns:
object

Definition at line 88 of file oxerpgenimport.php.

oxErpGenImport._setDbLayerVersion (  )  [protected]

Setting DB layer version to latest

Returns:
null

Definition at line 98 of file oxerpgenimport.php.

oxErpGenImport._modifyData ( aData,
oType 
) [protected]

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

Parameters:
array $aData CSV data
object $oType object type
Returns:
array

Reimplemented from oxErpCsv.

Definition at line 114 of file oxerpgenimport.php.

oxErpGenImport._mapFields ( aData,
oType 
) [protected]

Maps numeric array to assoc. Array

Parameters:
array $aData numeric indices
object $oType object type
Returns:
array assoc. indices

Definition at line 127 of file oxerpgenimport.php.

oxErpGenImport._getImportType ( &$  aData  )  [protected]

Gets import object type according type prefix

Parameters:
array &$aData CSV data
Exceptions:
Exeption if no such import type prefix
Returns:
string

Reimplemented from oxErpCsv.

Definition at line 149 of file oxerpgenimport.php.

oxErpGenImport._getImportMode ( aData  )  [protected]

Gets import mode

Parameters:
array $aData CSV data
Returns:
string

Reimplemented from oxErpCsv.

Definition at line 167 of file oxerpgenimport.php.

oxErpGenImport.getImportObject ( sType  ) 

Get imort object according import type

Parameters:
string $sType import object type
Returns:
object

Definition at line 179 of file oxerpgenimport.php.

oxErpGenImport.setImportTypePrefix ( sType  ) 

Set import object type prefix

Parameters:
string $sType import type prefix
Returns:
null

Definition at line 196 of file oxerpgenimport.php.

oxErpGenImport.getImportObjectsList (  ) 

Get allowed for import objects list

Returns:
array

Definition at line 206 of file oxerpgenimport.php.

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

Init ERP Framework parameters Creates Objects, checks Rights etc.

Parameters:
mixed $sUserName user name
mixed $sPassword password
integer $iShopID shop ID
integer $iLanguage language ID
Returns:
boolean

Reimplemented from oxERPBase.

Definition at line 226 of file oxerpgenimport.php.

oxErpGenImport.setCsvFileFieldsOrder ( aCsvFields  ) 

Set CSV file comumns names

Parameters:
array $aCsvFields CSV fields
Returns:
null

Definition at line 256 of file oxerpgenimport.php.

oxErpGenImport.setCsvContainsHeader ( blCsvContainsHeader  ) 

Set if CSV file contains header row

Parameters:
bool $blCsvContainsHeader has or not file header
Returns:
null

Definition at line 268 of file oxerpgenimport.php.

oxErpGenImport.getTotalImportedRowsNumber (  ) 

Get succesfully imported rows number

Returns:
int

Definition at line 278 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 $sPath full path of the CSV file.
string $sUserName user name
string $sUserPassword password
integer $sShopId shop ID
integer $sShopLanguage language ID
Returns:
string

Definition at line 302 of file oxerpgenimport.php.


Member Data Documentation

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.$_aCsvFileFieldsOrder = array() [protected]

Definition at line 35 of file oxerpgenimport.php.

oxErpGenImport.$_blCsvContainsHeader = null [protected]

Definition at line 42 of file oxerpgenimport.php.


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

Generated on Wed Apr 22 12:30:59 2009 for OXID eShop CE by  doxygen 1.5.5