From 5fd0464b68d0c87c32ecbb838cfb9c9274d4e23d Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 22 Aug 2008 03:36:00 +0000 Subject: [PATCH] ENHANCEMENT Added LowerCase() to DBField to return the raw2xml converted value as lower case for any type of field if applicable git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@61415 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/fieldtypes/DBField.php | 8 ++++++++ core/model/fieldtypes/Varchar.php | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/model/fieldtypes/DBField.php b/core/model/fieldtypes/DBField.php index 03433454a..a8269347e 100644 --- a/core/model/fieldtypes/DBField.php +++ b/core/model/fieldtypes/DBField.php @@ -168,6 +168,14 @@ abstract class DBField extends ViewableData { return Convert::raw2xml($this->value); } + /** + * Converts the current value for this Enum DBField to lowercase. + * @return string + */ + function LowerCase() { + return Convert::raw2xml(strtolower($this->value)); + } + /** * Returns the value to be set in the database to blank this field. * Usually it's a choice between null, 0, and '' diff --git a/core/model/fieldtypes/Varchar.php b/core/model/fieldtypes/Varchar.php index 4b13ab91f..4e74952cd 100644 --- a/core/model/fieldtypes/Varchar.php +++ b/core/model/fieldtypes/Varchar.php @@ -48,10 +48,6 @@ class Varchar extends DBField { return $this->raw2HTML(); }*/ - function LowerCase() { - return Convert::raw2xml(strtolower($this->value)); - } - function LimitCharacters($limit = 20, $add = "...") { $value = trim($this->value); return (strlen($value) > $limit) ? substr($value, 0, $limit) . $add : $value;