dolibarr 21.0.0-beta
PriceGlobalVariableUpdater Class Reference

Class for price global variable updaters table. More...

Public Member Functions

 __construct ($db)
 Constructor.
 
 create ($user, $notrigger=0)
 Create object into database.
 
 fetch ($id)
 Load object in memory from the database.
 
 update ($user=null, $notrigger=0)
 Update object into database.
 
 delete ($rowid, $user, $notrigger=0)
 Delete object in database.
 
 initAsSpecimen ()
 Initialise object with example values Id must be 0 if object instance is a specimen.
 
 getLastUpdated ()
 Returns the last updated time in string html format, returns "never" if its less than 1.
 
 checkParameters ()
 Checks if all parameters are in order.
 
 listUpdaters ()
 List all price global variables.
 
 listPendingUpdaters ()
 List all updaters which need to be processed.
 
 process ()
 Handles the processing of this updater.
 
 update_next_update ($next_update, $user=null, $notrigger=0)
 Update next_update into database.
 
 update_status ($last_status, $user=null, $notrigger=0)
 Update last_status into database.
 

Public Attributes

 $types = array(0, 1)
 Updater types.
 
 $update_min = 5
 Minimal update rate.
 

Detailed Description

Class for price global variable updaters table.

Definition at line 32 of file price_global_variable_updater.class.php.

Constructor & Destructor Documentation

◆ __construct()

PriceGlobalVariableUpdater::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 106 of file price_global_variable_updater.class.php.

Member Function Documentation

◆ checkParameters()

PriceGlobalVariableUpdater::checkParameters ( )

Checks if all parameters are in order.

Returns
void

Definition at line 370 of file price_global_variable_updater.class.php.

References $update_min, description, and type.

Referenced by create(), fetch(), process(), update(), update_next_update(), and update_status().

◆ create()

PriceGlobalVariableUpdater::create ( $user,
$notrigger = 0 )

Create object into database.

Parameters
User$userUser that creates
int$notrigger0=launch triggers after, 1=disable triggers
Returns
int Return integer <0 if KO, Id of created object if OK

Definition at line 119 of file price_global_variable_updater.class.php.

References checkParameters(), description, dol_syslog(), and type.

◆ delete()

PriceGlobalVariableUpdater::delete ( $rowid,
$user,
$notrigger = 0 )

Delete object in database.

Parameters
int$rowidRow id of global variable
User$userUser that deletes
int$notrigger0=launch triggers after, 1=disable triggers
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 283 of file price_global_variable_updater.class.php.

References dol_syslog().

◆ fetch()

PriceGlobalVariableUpdater::fetch ( $id)

Load object in memory from the database.

Parameters
int$idId object
Returns
int Return integer < 0 if KO, 0 if OK but not found, > 0 if OK

Definition at line 184 of file price_global_variable_updater.class.php.

References checkParameters(), description, dol_syslog(), and type.

◆ getLastUpdated()

PriceGlobalVariableUpdater::getLastUpdated ( )

Returns the last updated time in string html format, returns "never" if its less than 1.

Returns
string

Definition at line 354 of file price_global_variable_updater.class.php.

References dol_print_date().

◆ initAsSpecimen()

PriceGlobalVariableUpdater::initAsSpecimen ( )

Initialise object with example values Id must be 0 if object instance is a specimen.

Returns
int

Definition at line 335 of file price_global_variable_updater.class.php.

References description, and type.

◆ listPendingUpdaters()

PriceGlobalVariableUpdater::listPendingUpdaters ( )

List all updaters which need to be processed.

Returns
PriceGlobalVariableUpdater[]|int<-1,-1> Array of price global variable updaters

Definition at line 439 of file price_global_variable_updater.class.php.

References dol_syslog().

◆ listUpdaters()

PriceGlobalVariableUpdater::listUpdaters ( )

List all price global variables.

Returns
PriceGlobalVariableUpdater[]|int<-1,-1> Array of price global variable updaters

Definition at line 402 of file price_global_variable_updater.class.php.

References dol_syslog().

◆ process()

PriceGlobalVariableUpdater::process ( )

Handles the processing of this updater.

Returns
int Return integer <0 if KO, 0 if OK but no global variable found, >0 if OK

Definition at line 477 of file price_global_variable_updater.class.php.

References checkParameters(), dol_syslog(), getURLContent(), and type.

◆ update()

PriceGlobalVariableUpdater::update ( $user = null,
$notrigger = 0 )

Update object into database.

Parameters
User | null$userUser that modifies
int$notrigger0=launch triggers after, 1=disable triggers
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 221 of file price_global_variable_updater.class.php.

References checkParameters(), description, dol_syslog(), and type.

◆ update_next_update()

PriceGlobalVariableUpdater::update_next_update ( $next_update,
$user = null,
$notrigger = 0 )

Update next_update into database.

Parameters
int$next_updateNext update to write
?User$userUser that modifies
int<0,1>$notrigger 0=launch triggers after, 1=disable triggers
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 592 of file price_global_variable_updater.class.php.

References checkParameters(), and dol_syslog().

◆ update_status()

PriceGlobalVariableUpdater::update_status ( $last_status,
$user = null,
$notrigger = 0 )

Update last_status into database.

Parameters
string$last_statusStatus to write
User | null$userUser that modifies
int$notrigger0=launch triggers after, 1=disable triggers
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 637 of file price_global_variable_updater.class.php.

References checkParameters(), and dol_syslog().


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