Class Text
Represents a variable-length string of up to 2 megabytes, designed to store raw text
Example definition via DataObject::$db:
static $db = array( "MyDescription" => "Text", );
- Object
-
ViewableData
implements
IteratorAggregate
-
DBField
-
StringField
-
Text
Direct known subclasses
See:
HTMLTextSee:
HTMLVarcharSee:
VarcharLocated at sapphire/core/model/fieldtypes/Text.php
Methods summary
public
|
|
public
string
|
#
LimitWordCount( integer $numWords = 26, string $add = '...' )
Limit this field's content by a number of words. CAUTION: This is not XML
safe. Please use |
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
#
LimitCharacters( integer $limit = 20, string $add = "..." )
Limit this field's content by a number of characters. CAUTION: Does not take into account HTML tags, so it has the potential to return malformed HTML. |
public
string
|
#
LimitWordCountXML( integer $numWords = 26, string $add = '...' )
Limit the number of words of the current field's content. This is XML safe, so characters like & are converted to & |
public
|
#
LimitSentences( integer $sentCount = 2 )
Limit sentences, can be controlled by passing an integer. |
public
|
|
public
|
|
public
|
#
BigSummary( mixed $maxWords = 50, mixed $plain = 1 )
Performs the same function as the big summary, but doesnt trim new paragraphs off data. Caution: Not XML/HTML-safe - does not respect closing tags. |
public
|
|
public
string
|
#
ContextSummary( integer $characters = 500, boolean $string = false, boolean $striphtml = true, boolean $highlight = true, String $prefix = "... ", String $suffix = "..." )
Perform context searching to give some context to searches, optionally highlighting the search term. |
public
string
|
|
public
|
|
public
|
Methods inherited from StringField
Lower(),
Upper(),
__construct(),
getNullifyEmpty(),
hasValue(),
prepValueForDB(),
setNullifyEmpty(),
setOptions()
Methods inherited from DBField
ATT(),
HTML(),
HTMLATT(),
JS(),
LowerCase(),
RAW(),
RAWURLATT(),
URLATT(),
UpperCase(),
XML(),
addToQuery(),
create(),
debug(),
defaultSearchFilter(),
exists(),
forTemplate(),
getName(),
getValue(),
nullValue(),
saveInto(),
setName(),
setTable(),
setValue(),
writeToManipulation()
Methods inherited from ViewableData
ATT_val(),
BaseHref(),
CSSClasses(),
CurrentMember(),
CurrentPage(),
Debug(),
Even(),
EvenOdd(),
First(),
FirstLast(),
HasPerm(),
IsAjax(),
JS_val(),
Last(),
Me(),
Middle(),
MiddleString(),
Modulus(),
MultipleOf(),
Odd(),
Pos(),
RAW_val(),
SQL_val(),
ThemeDir(),
Top(),
TotalItems(),
XML_val(),
__get(),
__isset(),
__set(),
buildCastingCache(),
cachedCall(),
castingClass(),
castingHelper(),
castingHelperPair(),
castingObjectCreator(),
castingObjectCreatorPair(),
customise(),
defineMethods(),
escapeTypeForField(),
getField(),
getIterator(),
getSecurityID(),
getXMLValues(),
hasField(),
i18nLocale(),
iteratorProperties(),
obj(),
renderWith(),
setCustomisedObj(),
setField()
Methods inherited from Object
__call(),
__toString(),
addMethodsFrom(),
addStaticVars(),
addWrapperMethod(),
add_extension(),
add_static_var(),
allMethodNames(),
cacheToFile(),
cacheToFileWithArgs(),
clearCache(),
combined_static(),
createMethod(),
create_from_string(),
extInstance(),
extend(),
getCustomClass(),
getExtensionInstance(),
getExtensionInstances(),
get_extensions(),
get_static(),
hasExtension(),
hasMethod(),
has_extension(),
invokeWithExtensions(),
is_a(),
loadCache(),
parentClass(),
parse_class_spec(),
remove_extension(),
sanitiseCachename(),
saveCache(),
set_stat(),
set_static(),
set_uninherited(),
stat(),
strong_create(),
uninherited(),
uninherited_static(),
useCustomClass()
Magic methods summary
Properties summary
public static
array
|
$casting |
#
An array of objects to cast certain fields to. This is set up as an array in the format: |
Properties inherited from StringField
Properties inherited from DBField
$arrayValue,
$defaultVal,
$default_search_filter_class,
$escape_type,
$name,
$tableName,
$value
Properties inherited from ViewableData
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems
Comments
Use the Silverstripe Forum to ask questions.