class PriceGlobalVariable (View source)

Class for accessing price global variables table

Properties

DoliDB $db
string $error
string[] $errors
int $id
?string $code
string $description
int|string|float $value
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

void
checkParameters()

Checks if all parameters are in order

listGlobalVariables()

List all price global variables

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<0,1> $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

void checkParameters()

Checks if all parameters are in order

Return Value

void

listGlobalVariables()

List all price global variables

@return PriceGlobalVariable[]|int<-1,-1> Array of price global variables, <0 if ko