class PriceExpression (View source)

Class for accessing price expression table

Properties

DoliDB $db
string $error
string[] $errors
int $id
string $title
string $expression
string $table_element

Methods

__construct($db)

Constructor

create(User $user, int $notrigger = 0)

Create object into database

int
fetch($id)

Load object in memory from the database

list_price_expression()

List all price expressions

int
find_title($title)

Returns any existing rowid with specified title

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

Update object into database

delete(User $user, $notrigger = 0)

Delete object in database

initAsSpecimen()

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

Details

__construct($db)

Constructor

@param DoliDB $db Database handler

Parameters

$db

create(User $user, int $notrigger = 0)

Create object into database

@param User $user User that creates

Parameters

User $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

list_price_expression()

List all price expressions

@return PriceExpression[]|int Array of price expressions, <0 if ko

int find_title($title)

Returns any existing rowid with specified title

@param string $title Title of expression

Parameters

$title

Return Value

int

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

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

Update object into database

@param User $user User that modifies

Parameters

User $user
int $notrigger

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

delete(User $user, $notrigger = 0)

Delete object in database

Parameters

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

initAsSpecimen()

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

@return int