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
This commit is contained in:
Sean Harvey 2008-08-22 03:36:00 +00:00
parent 65604f4ab6
commit 5fd0464b68
2 changed files with 8 additions and 4 deletions

View File

@ -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 ''

View File

@ -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;