class Cchargesociales (View source)

Class Cchargesociales

Properties

DoliDB $db
int $id
string $element
string $table_element
string deprecated $libelle
string $label
string $deductible
?int<0, 1> $active
string $code
?int $fk_pays
string $module
string $accountancy_code
string[] $errors

Methods

__construct(DoliDB $db)

Constructor

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

Create object into database

int
fetch(int $id, string $ref = null)

Load object in memory from the database

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

Update object into database

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

Delete object in database

LibStatut($status, int $mode = 0)

Return the label of a given status

int
initAsSpecimen()

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

Details

__construct(DoliDB $db)

Constructor

Parameters

DoliDB $db

Database handler

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

Create object into database

Parameters

User $user

User that creates

int $notrigger

0=launch triggers after, 1=disable triggers

Return Value

int

Return integer <0 if KO, Id of created object if OK

int fetch(int $id, string $ref = null)

Load object in memory from the database

Parameters

int $id

Id object

string $ref Ref

Return Value

int

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

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

Update object into database

Parameters

User $user

User that modifies

int $notrigger

0=launch triggers after, 1=disable triggers

Return Value

int

Return integer <0 if KO, >0 if OK

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

Delete object in database

Parameters

User $user

User that deletes

int $notrigger

0=launch triggers after, 1=disable triggers

Return Value

int

Return integer <0 if KO, >0 if OK

LibStatut($status, int $mode = 0)

Return the label of a given status

@param int $status Id status

Parameters

$status
int $mode

0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto @return string Label of status

int initAsSpecimen()

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

Return Value

int