Explorar o código

New helper function IsModified

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@101 a333f486-631f-4898-b8df-5754b55c2be0
dflaven %!s(int64=16) %!d(string=hai) anos
pai
achega
f855ddbc77
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      core/dbobject.class.php

+ 7 - 0
core/dbobject.class.php

@@ -533,6 +533,13 @@ abstract class DBObject
 		return $this->ListChangedValues($this->m_aCurrValues);
 	}
 
+	// Tells whether or not an object was modified
+	public function IsModified()
+	{
+		$aChanges = $this->ListChanges();
+		return (count($aChanges) != 0);
+	}
+
 	// used both by insert/update
 	private function DBWriteLinks()
 	{