dolibarr 21.0.0-beta
Import Class Reference

Class to manage imports. More...

Public Member Functions

 __construct ($db)
 Constructor.
 
 load_arrays ($user, $filter='')
 Load description int this->array_import_module, this->array_import_fields, ... of an importable dataset.
 
 build_example_file ($model, $headerlinefields, $contentlinevalues, $datatoimport)
 Build an import example file.
 
 create ($user)
 Save an import model in database.
 
 fetch ($id)
 Load an import profil from database.
 
 delete ($user, $notrigger=0)
 Delete object in database.
 

Detailed Description

Class to manage imports.

Definition at line 31 of file import.class.php.

Constructor & Destructor Documentation

◆ __construct()

Import::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 163 of file import.class.php.

Member Function Documentation

◆ build_example_file()

Import::build_example_file ( $model,
$headerlinefields,
$contentlinevalues,
$datatoimport )

Build an import example file.

Arrays this->array_export_xxx are already loaded for required datatoexport

Parameters
string$modelName of import engine ('csv', ...)
string$headerlinefieldsArray of values for first line of example file
string$contentlinevaluesArray of values for content line of example file
string$datatoimportDataset to import
Returns
string Return integer <0 if KO, >0 if OK

Definition at line 312 of file import.class.php.

References $conf, and dol_syslog().

◆ create()

Import::create ( $user)

Save an import model in database.

Parameters
User$userObject user that save
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 353 of file import.class.php.

References $conf, and dol_syslog().

◆ delete()

Import::delete ( $user,
$notrigger = 0 )

Delete object in database.

Parameters
User$userUser that delete
int<0,1>$notrigger 0=launch triggers after, 1=disable triggers
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 440 of file import.class.php.

References dol_syslog().

◆ fetch()

Import::fetch ( $id)

Load an import profil from database.

Parameters
int$idId of profil to load
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 406 of file import.class.php.

References dol_print_error(), and dol_syslog().

◆ load_arrays()

Import::load_arrays ( $user,
$filter = '' )

Load description int this->array_import_module, this->array_import_fields, ... of an importable dataset.

Parameters
User$userObject user making import
string$filterLoad a particular dataset only. Index will start to 0.
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 177 of file import.class.php.

References $conf, dol_osencode(), dol_syslog(), and dolGetModulesDirs().


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