浏览代码

Proper output of boolean values in JSON.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3155 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 11 年之前
父节点
当前提交
1167b6a444
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      core/attributedef.class.inc.php

+ 8 - 0
core/attributedef.class.inc.php

@@ -1293,6 +1293,14 @@ class AttributeBoolean extends AttributeInteger
 	{
 		return $sValue ? '1' : '0';
 	}
+	/**
+	 * Helper to get a value that will be JSON encoded
+	 * The operation is the opposite to FromJSONToValue	 
+	 */	 	
+	public function GetForJSON($value)
+	{
+		return $value ? '1' : '0';
+	}
 }
 
 /**