浏览代码

New helper function IsModified

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@101 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 16 年之前
父节点
当前提交
f855ddbc77
共有 1 个文件被更改,包括 7 次插入0 次删除
  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()
 	{