From 4814521e93092420349157bcc0761624de21cf44 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 16 Oct 2008 11:58:31 +0000 Subject: [PATCH] MINOR Marked some Convert methods as deprecated, as their purpose is unclear, they're neither documented nor tested. Stuff like Convert::xml2js() is just way too fuzzy git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64412 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Convert.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/core/Convert.php b/core/Convert.php index c080a6186..ef526e50f 100755 --- a/core/Convert.php +++ b/core/Convert.php @@ -123,18 +123,31 @@ class Convert extends Object { } } } + + /** + * @deprecated 2.3 Functionality too ambiguous - not sure if its converting + * xml trees to js objects, xml properties to json, ... + */ static function xml2js($val) { return self::raw2js(self::html2raw($val)); } + + /** + * @deprecated 2.3 use raw2att() + */ static function xml2att($val) { return self::raw2att(self::xml2raw($val)); } + + /** + * @deprecated 2.3 Use raw2sql() + */ static function xml2sql($val) { return self::raw2sql(self::xml2raw($val)); } /** - * Convert JS to other formats + * @deprecated 2.3 */ static function js2raw($val) { if(is_array($val)) { @@ -145,13 +158,24 @@ class Convert extends Object { return str_replace(array('\"','\n','\r'), array('"',"\n","\r"), $val); } } + + /** + * @deprecated 2.3 Use raw2xml() + */ static function js2xml($val) { return self::raw2xml(self::js2raw($val)); } + + /** + * @deprecated 2.3 Use raw2att() + */ static function js2att($val) { return self::raw2att(self::js2raw($val)); } + /** + * @deprecated 2.3 Use raw2sql() + */ static function js2sql($val) { return self::raw2sql(self::js2raw($val)); }