dolibarr 18.0.6
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 export 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 30 of file import.class.php.

Constructor & Destructor Documentation

◆ __construct()

Import::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 81 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 <0 if KO, >0 if OK

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

References dol_syslog().

◆ create()

Import::create ( $user)

Save an export model in database.

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

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

References dol_syslog().

◆ delete()

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

Delete object in database.

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

Definition at line 350 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 <0 if KO, >0 if OK

Definition at line 316 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 <0 if KO, >0 if OK

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

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


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