class PriceGlobalVariableUpdater (View source)

Class for price global variable updaters table

Properties

DoliDB $db
string $error
string[] $errors
int[] $types
int $update_min
int $id
int $type
string $description
?string $parameters
int $fk_variable
int $update_interval
int $next_update
?string $last_status
string $table_element

Methods

__construct($db)

Constructor

create($user, int $notrigger = 0)

Create object into database

int
fetch($id)

Load object in memory from the database

update($user = null, int $notrigger = 0)

Update object into database

delete($rowid, User $user, $notrigger = 0)

Delete object in database

int
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

void
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 $user = null, $notrigger = 0)

Update next_update into database

update_status($last_status, User|null $user = null, $notrigger = 0)

Update last_status into database

Details

__construct($db)

Constructor

@param DoliDB $db Database handler

Parameters

$db

create($user, int $notrigger = 0)

Create object into database

@param User $user User that creates

Parameters

$user
int $notrigger

0=launch triggers after, 1=disable triggers @return int Return integer <0 if KO, Id of created object if OK

int fetch($id)

Load object in memory from the database

@param int $id Id object

Parameters

$id

Return Value

int

Return integer < 0 if KO, 0 if OK but not found, > 0 if OK

update($user = null, int $notrigger = 0)

Update object into database

@param User|null $user User that modifies

Parameters

$user
int $notrigger

0=launch triggers after, 1=disable triggers @return int Return integer <0 if KO, >0 if OK

delete($rowid, User $user, $notrigger = 0)

Delete object in database

@param  int     $rowid       Row id of global variable

Parameters

$rowid
User $user

User that deletes @param int $notrigger 0=launch triggers after, 1=disable triggers @return int Return integer <0 if KO, >0 if OK

$notrigger

int initAsSpecimen()

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

Return Value

int

getLastUpdated()

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

@return string

void checkParameters()

Checks if all parameters are in order

Return Value

void

listUpdaters()

List all price global variables

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

listPendingUpdaters()

List all updaters which need to be processed

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

process()

Handles the processing of this updater

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

update_next_update($next_update, User $user = null, $notrigger = 0)

Update next_update into database

@param int $next_update Next update to write

Parameters

$next_update
User $user

User that modifies @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers @return int Return integer <0 if KO, >0 if OK

$notrigger

update_status($last_status, User|null $user = null, $notrigger = 0)

Update last_status into database

@param string $last_status Status to write

Parameters

$last_status
User|null $user

User that modifies @param int $notrigger 0=launch triggers after, 1=disable triggers @return int Return integer <0 if KO, >0 if OK

$notrigger