add callbacks on onPostUpdateAttribute and onPostAddAttribute

This commit is contained in:
Uwe Steinmann 2022-02-25 12:31:57 +01:00
parent efc724e773
commit c9fae356b3
3 changed files with 18 additions and 0 deletions

View File

@ -259,6 +259,14 @@ class SeedDMS_Core_Attribute { /* {{{ */
$this->_value = $value;
/* Check if 'onPostUpdateAttribute' callback is set */
if(isset($this->_dms->callbacks['onPostUpdateAttribute'])) {
foreach($this->_dms->callbacks['onPostUpdateAttribute'] as $callback) {
if(!call_user_func($callback[0], $callback[1], $this->_obj, $this->_attrdef, $value)) {
}
}
}
return true;
} /* }}} */

View File

@ -269,6 +269,15 @@ class SeedDMS_Core_Object { /* {{{ */
$attr = new SeedDMS_Core_Attribute($db->getInsertID($tablename), $this, $attrdef, $value);
$attr->setDMS($this->_dms);
$this->_attributes[$attrdef->getId()] = $attr;
/* Check if 'onPostAddAttribute' callback is set */
if(isset($this->_dms->callbacks['onPostAddAttribute'])) {
foreach($this->_dms->callbacks['onPostAddAttribute'] as $callback) {
if(!call_user_func($callback[0], $callback[1], $this, $attrdef, $value)) {
}
}
}
return true;
}

View File

@ -28,6 +28,7 @@
- getLastWorkflowLog() returns a workflow entry even if the workflow has ended
- backport setFileType() from 6.0.x
- add SeedDMS_Core_File::fileExtension()
- add callbacks on onPostUpdateAttribute and onPostAddAttribute
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">