mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 10:08:45 +02:00
N°2293 Saves changes in DBObjet::DBUpdate, just before the AfterUpdate call
This will allow to get changes made in ComputeValues, OnUpdate, etc
This commit is contained in:
@@ -133,6 +133,11 @@ abstract class DBObject implements iDisplay
|
||||
* * false => not modified (the same value as the original value was set)
|
||||
*/
|
||||
protected $m_aModifiedAtt = array();
|
||||
/**
|
||||
* @var array attname => currentvalue Persists changes for {@link DBUpdate}
|
||||
* @since 2.7.0 N°2293
|
||||
*/
|
||||
protected $m_aChanges;
|
||||
/**
|
||||
* @var array Set of Synch data related to this object
|
||||
* <ul>
|
||||
@@ -3015,6 +3020,8 @@ abstract class DBObject implements iDisplay
|
||||
throw new CoreException("DBUpdate: could not update a newly created object, please call DBInsert instead");
|
||||
}
|
||||
|
||||
$this->m_aChanges = array(); // reset attribute to avoid stack collisions
|
||||
|
||||
$iNbTryRemaining = 3;
|
||||
while ($iNbTryRemaining > 0)
|
||||
{
|
||||
@@ -3164,6 +3171,8 @@ abstract class DBObject implements iDisplay
|
||||
$this->DBWriteLinks();
|
||||
$this->WriteExternalAttributes();
|
||||
|
||||
$this->m_aChanges = $this->ListChanges(); // N°2293 save changes for use in user callbacks
|
||||
|
||||
$this->AfterUpdate();
|
||||
|
||||
$this->m_bDirty = false;
|
||||
|
||||
Reference in New Issue
Block a user