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

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

Public Member Functions

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

Public Attributes

 $db
 To store db handler.
 
 $error
 To return error code (or message)
 
 $errors =array()
 To return several error codes (or messages)
 
 $types =array(0, 1)
 Updater types.
 
 $update_min = 5
 Minimal update rate.
 
 $update_interval
 Interval in mins.
 
 $next_update
 Next update timestamp.
 

Detailed Description

Class for price global variable updaters table.

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

Constructor & Destructor Documentation

PriceGlobalVariableUpdater::__construct (   $db)

Constructor.

Parameters
DoliDb$dbDatabase handler

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

References $db.

Member Function Documentation

PriceGlobalVariableUpdater::checkParameters ( )

Checks if all parameters are in order.

Returns
void

Definition at line 325 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().

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

Create object into database.

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

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

References $error, $resql, checkParameters(), description, and dol_syslog().

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 <0 if KO, >0 if OK

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

References $error, $resql, and dol_syslog().

PriceGlobalVariableUpdater::fetch (   $id)

Load object in memory from the database.

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

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

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

PriceGlobalVariableUpdater::getLastUpdated ( )

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

Returns
string

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

References dol_print_date().

PriceGlobalVariableUpdater::initAsSpecimen ( )

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

Returns
void

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

References description, and type.

PriceGlobalVariableUpdater::listPendingUpdaters ( )

List all updaters which need to be processed.

Returns
array Array of price global variable updaters

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

References $resql, and dol_syslog().

PriceGlobalVariableUpdater::listUpdaters ( )

List all price global variables.

Returns
array Array of price global variable updaters

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

References $resql, and dol_syslog().

PriceGlobalVariableUpdater::process ( )

Handles the processing of this updater.

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

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

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

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

Update object into database.

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

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

References $error, $resql, checkParameters(), description, and dol_syslog().

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

Update next_update into database.

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

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

References $error, $next_update, $resql, checkParameters(), and dol_syslog().

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

Update last_status into database.

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

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

References $error, $resql, checkParameters(), and dol_syslog().


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