60 public $errors = array();
69 public $TRIGGER_PREFIX =
'';
83 public function call_trigger($triggerName, $user)
88 if (!empty($this->TRIGGER_PREFIX) && strpos($triggerName, $this->TRIGGER_PREFIX .
'_') !== 0) {
89 if (!preg_match(
'/^OBJECT_LINK/', $triggerName) && !preg_match(
'/^PAYMENTONLINE_/', $triggerName)) {
90 dol_syslog(
'The trigger "' . $triggerName .
'" does not start with "' . $this->TRIGGER_PREFIX .
'_" as required.', LOG_ERR);
95 if (!is_object($langs)) {
97 include_once DOL_DOCUMENT_ROOT.
'/core/class/translate.class.php';
99 $langs->setDefaultLang(
'');
100 $langs->load(
"main");
103 include_once DOL_DOCUMENT_ROOT.
'/core/class/interfaces.class.php';
105 $result = $interface->run_triggers($triggerName, $this, $user, $langs, $conf);
108 if (!empty($this->errors)) {
109 $this->errors = array_unique(array_merge($this->errors, $interface->errors));
111 $this->errors = $interface->errors;
Class to manage triggers.
Class to manage translations.
getCallerInfoString()
Get caller info as a string that can be appended to a log message.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.