Browse Source

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 years ago
parent
commit
1167b6a444
1 changed files with 8 additions and 0 deletions
  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';
+	}
 }
 
 /**