dolibarr  7.0.0-beta
Public Member Functions | List of all members
Import Class Reference

Class to manage imports. More...

Public Member Functions

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

Detailed Description

Class to manage imports.

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

Constructor & Destructor Documentation

Import::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

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

Member Function Documentation

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 190 of file import.class.php.

References dol_syslog().

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 229 of file import.class.php.

References $resql, and dol_syslog().

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 309 of file import.class.php.

References $resql, and dol_syslog().

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 269 of file import.class.php.

References dol_print_error(), and dol_syslog().

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 68 of file import.class.php.

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


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