Explorar o código

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 %!s(int64=11) %!d(string=hai) anos
pai
achega
1167b6a444
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  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';
+	}
 }
 
 /**