mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
65604f4ab6
commit
5fd0464b68
@ -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 ''
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user