diff --git a/application/datamodel.application.xml b/application/datamodel.application.xml index 8095c6368..c9799d60c 100644 --- a/application/datamodel.application.xml +++ b/application/datamodel.application.xml @@ -237,6 +237,27 @@ + + + + attcode + true + + allow + + + + + + + + + + string + false + + + diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 2523614eb..d168d40a4 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -3976,6 +3976,30 @@ abstract class DBObject implements iDisplay public function SetCurrentDate($sAttCode) { $this->Set($sAttCode, time()); + + return true; + } + + /** + * Helper to add a value to the given attribute + * + * Suitable for use as a lifecycle action + * + * @api + * + * @param string $sAttCode + * @param int|float $iValue + * + * @return bool + * + * @throws \CoreException + * @throws \CoreUnexpectedValue + * @since 3.0.0 + */ + public function AddValue($sAttCode, $iValue = 1) + { + $this->Set($sAttCode, $this->Get($sAttCode) + $iValue); + return true; }