class Interfaces (View source)

Class to manage triggers

Properties

DoliDB $db
string $dir
string $lastmoduleerror
string[] $errors

Methods

__construct($db)

Constructor

run_triggers($action, ?object $object, $user, $langs, $conf)

Function called when a Dolibarr business event occurs This function call all qualified triggers.

array<array{picto: string, file: string, fullpath: string, relpath: string, iscoreorexternal?: "internal"|"external", version?: string, status?: string, module?: string, info: string}>
getTriggersList(?array<int, string> $forcedirtriggers = null)

Return list of triggers. Function used by admin page htdoc/admin/triggers.

Details

__construct($db)

Constructor

@param DoliDB $db Database handler

Parameters

$db

run_triggers($action, ?object $object, $user, $langs, $conf)

Function called when a Dolibarr business event occurs This function call all qualified triggers.

@param string $action Trigger event code

Parameters

$action
?object $object

Object concerned. Some context information may also be provided into array property object->context. @param ?User $user Object user @param ?Translate $langs Object lang @param ?Conf $conf Object conf @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise.

$user
$langs
$conf

array<array{picto: string, file: string, fullpath: string, relpath: string, iscoreorexternal?: "internal"|"external", version?: string, status?: string, module?: string, info: string}> getTriggersList(?array<int, string> $forcedirtriggers = null)

Return list of triggers. Function used by admin page htdoc/admin/triggers.

List is sorted by trigger filename so by priority to run.

Parameters

?array<int, string> $forcedirtriggers

null=All default directories. This parameter is used by modulebuilder module only.

Return Value

array<array{picto: string, file: string, fullpath: string, relpath: string, iscoreorexternal?: "internal"|"external", version?: string, status?: string, module?: string, info: string}>

Array list of triggers