Selaa lähdekoodia

Support for objects to go "out of the silo" during a transition by making sure that we can reload an object we've just saved.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4144 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 9 vuotta sitten
vanhempi
commit
570ec40c2b
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      core/dbobject.class.php

+ 3 - 3
core/dbobject.class.php

@@ -192,10 +192,10 @@ abstract class DBObject implements iDisplay
 		return true;
 		return true;
 	}
 	}
 
 
-	public function Reload()
+	public function Reload($bAllowAllData = false)
 	{
 	{
 		assert($this->m_bIsInDB);
 		assert($this->m_bIsInDB);
-		$aRow = MetaModel::MakeSingleRow(get_class($this), $this->m_iKey, false/*, $this->m_bAllowAllData*/);
+		$aRow = MetaModel::MakeSingleRow(get_class($this), $this->m_iKey, false /* must be found */, $bAllowAllData/* in the future $this->m_bAllowAllData ??*/);
 		if (empty($aRow))
 		if (empty($aRow))
 		{
 		{
 			throw new CoreException("Failed to reload object of class '".get_class($this)."', id = ".$this->m_iKey);
 			throw new CoreException("Failed to reload object of class '".get_class($this)."', id = ".$this->m_iKey);
@@ -1948,7 +1948,7 @@ abstract class DBObject implements iDisplay
 			// Reload to get the external attributes
 			// Reload to get the external attributes
 			if ($bHasANewExternalKeyValue)
 			if ($bHasANewExternalKeyValue)
 			{
 			{
-				$this->Reload();
+				$this->Reload(true /* AllowAllData */);
 			}
 			}
 			else
 			else
 			{
 			{