Classes:

search
AdvancedSearchForm
ContentControllerSearchExtension
EndsWithFilter
ExactMatchFilter
ExactMatchMultiFilter
FulltextFilter
FulltextSearchable
GreaterThanFilter
LessThanFilter
NegationFilter
PartialMatchFilter
SearchContext
SearchFilter
SearchForm
StartsWithFilter
StartsWithMultiFilter
SubstringFilter
WithinRangeFilter
core
Aggregate
Aggregate_Relationship
ClassInfo
CSSContentParser
Extension
ManifestBuilder
Object
SS_Cache
TokenisedRegularExpression
ValidationResult
YamlFixture
filesystem
Archive
File
Filesystem
FlushGeneratedImagesTask
Folder
Folder_UnusedAssetsField
GD
Image
Image_Cached
TarballArchive
Upload
Upload_Validator
view
ArrayData
Requirements
Requirements_Backend
SSViewer
SSViewer_Cached_PartialParser
SSViewer_FromString
SSViewer_PartialParser
ViewableData
ViewableData_Customised
ViewableData_Debugger
misc
ArrayLib
BBCodeParser
Convert
Cookie
DataDifferencer
Geoip
HTMLCleaner
HTTP
i18n
Profiler
ShortcodeParser
SSHTMLBBCodeParser
SSHTMLBBCodeParser_Filter
SSHTMLBBCodeParser_Filter_Basic
SSHTMLBBCodeParser_Filter_EmailLinks
SSHTMLBBCodeParser_Filter_Extended
SSHTMLBBCodeParser_Filter_Images
SSHTMLBBCodeParser_Filter_Links
SSHTMLBBCodeParser_Filter_Lists
TextParser
Translatable_Transformation
XML
security
Authenticator
BasicAuth
ChangePasswordForm
Group
GroupCsvBulkLoader
LoginAttempt
LoginForm
Member
MemberAuthenticator
MemberCsvBulkLoader
MemberLoginForm
MemberPassword
Member_ChangePasswordEmail
Member_DatetimeOptionsetField
Member_ForgotPasswordEmail
Member_GroupSet
Member_ProfileForm
Member_SignupEmail
Member_Validator
NullSecurityToken
NZGovtPasswordValidator
PasswordEncryptor
PasswordEncryptor_LegacyPHPHash
PasswordEncryptor_MySQLOldPassword
PasswordEncryptor_MySQLPassword
PasswordEncryptor_None
PasswordEncryptor_NotFoundException
PasswordEncryptor_PHPHash
PasswordValidator
Permission
PermissionCheckboxSetField
PermissionCheckboxSetField_Readonly
PermissionRole
PermissionRoleCode
Permission_Group
RandomGenerator
Security
SecurityToken
dev
BuildTask
CliDebugView
Debug
DebugView
DevelopmentAdmin
MigrationTask
MySQLDatabaseConfigurationHelper
PhpUnitWrapper
PhpUnitWrapper_3_4
PhpUnitWrapper_3_5
PhpUnitWrapper_Exception
SapphireREPL
SS_Backtrace
SS_Cli
SS_Log
SS_LogEmailWriter
SS_LogErrorEmailFormatter
SS_LogErrorFileFormatter
SS_LogFileWriter
SS_ZendLog
TaskRunner
model
Boolean
ComponentSet
Currency
DatabaseAdmin
DataObject
DataObjectDecorator
DataObjectLog
DataObjectSet
DataObjectSet_Iterator
Date
DB
DBField
Decimal
Double
Enum
Float
ForeignKey
Hierarchy
HTMLText
HTMLVarchar
Int
Money
MultiEnum
MySQLDatabase
MySQLQuery
Percentage
PrimaryKey
SiteTreeDecorator
SQLMap
SQLMap_Iterator
SQLQuery
SS_Database
SS_Datetime
SS_Query
StringField
Text
Time
Transliterator
Varchar
Versioned
Versioned_Version
Year
cron
CliController
DailyTask
HourlyTask
MonthlyTask
QuarterHourlyTask
ScheduledTask
WeeklyTask
YearlyTask
testing
CliTestReporter
FunctionalTest
InstallerTest
JSTestRunner
PHPUnit_Framework_TestCase
SapphireTest
SapphireTestReporter
SapphireTestSuite
SS_TestListener
TestRunner
TestSession
TestSession_STResponseWrapper
TestViewer
tools
CodeViewer
ModelViewer
ModelViewer_Field
ModelViewer_Model
ModelViewer_Module
ModelViewer_Relation
control
ContentController
ContentNegotiator
Controller
Director
ModelAsController
Page_Controller
RequestHandler
RootURLController
SapphireInfo
Session
SS_HTTPRequest
SS_HTTPResponse
SS_HTTPResponse_Exception
bulkloading
CSVParser
formatters
DataFormatter
FormEncodedDataFormatter
JSONDataFormatter
XMLDataFormatter
forms
DateField_View_JQuery
DatetimeField
FormScaffolder
NestedForm
i18n
DBLocale
i18nTextCollector
Translatable
email
Email
Email_BounceHandler
Email_BounceRecord
Mailer
QueuedEmail
QueuedEmailDispatchTask
TestMailer
tasks
EncryptAllPasswordsTask
i18nTextCollectorTask
MigrateSiteTreeLinkingTask
MigrateTranslatableTask
RemoveOrphanedPagesTask
UpgradeSiteTreePermissionSchemaTask
integration
RestfulService
RestfulService_Response
RSSFeed
RSSFeed_Entry
SapphireSoapServer
SS_HTMLValue
VersionedRestfulServer
fields-formattedinput
MoneyField
api
RestfulServer
RestfulServer_Item
RestfulServer_List
SOAPModelAccess
parsers
SQLFormatter
validation
ValidationException
widgets
Widget
WidgetArea
Widget_Controller
Widget_TreeDropdownField

Files:

Show/hide

DatabaseConfigurationHelper.php
DateField.php
Page.php
Translatable.php
subpackage api
RestfulServer.php
SOAPModelAccess.php
subpackage bulkloading
CSVParser.php
subpackage control
ContentController.php
ContentNegotiator.php
Controller.php
Director.php
HTTPRequest.php
HTTPResponse.php
ModelAsController.php
NestedController.php
RequestHandler.php
RootURLController.php
SapphireInfo.php
Session.php
subpackage core
Aggregate.php
Cache.php
ClassInfo.php
cli-script.php
ConfigureFromEnv.php
CSSContentParser.php
Extension.php
ManifestBuilder.php
Object.php
TokenisedRegularExpression.php
ValidationResult.php
YamlFixture.php
subpackage cron
CliController.php
DailyTask.php
HourlyTask.php
MonthlyTask.php
QuarterHourlyTask.php
ScheduledTask.php
WeeklyTask.php
YearlyTask.php
subpackage dev
Backtrace.php
BuildTask.php
Cli.php
CliDebugView.php
Debug.php
DebugView.php
DevelopmentAdmin.php
Log.php
LogEmailWriter.php
LogErrorEmailFormatter.php
LogErrorFileFormatter.php
LogFileWriter.php
MigrationTask.php
MySQLDatabaseConfigurationHelper.php
PhpUnitWrapper_3_4.php
PhpUnitWrapper_3_5.php
SapphireREPL.php
TaskRunner.php
ZendLog.php
subpackage email
Email.php
Mailer.php
QueuedEmail.php
QueuedEmailDispatchTask.php
TestMailer.php
subpackage fields-formattedinput
MoneyField.php
subpackage filesystem
Archive.php
File.php
Filesystem.php
FlushGeneratedImagesTask.php
Folder.php
GD.php
Image.php
TarballArchive.php
Upload.php
subpackage formatters
DataFormatter.php
FormEncodedDataFormatter.php
JSONDataFormatter.php
XMLDataFormatter.php
subpackage forms
DatetimeField.php
FormScaffolder.php
NestedForm.php
subpackage i18n
DBLocale.php
i18nEntityProvider.php
i18nTextCollector.php
subpackage integration
HTMLValue.php
RestfulService.php
RSSFeed.php
SapphireSoapServer.php
VersionedRestfulServer.php
subpackage misc
ArrayLib.php
Basic.php
BBCodeParser.php
Convert.php
Cookie.php
DataDifferencer.php
EmailLinks.php
Extended.php
Filter.php
Geoip.php
HTMLBBCodeParser.php
HTMLCleaner.php
HTTP.php
i18n.php
Images.php
Links.php
Lists.php
Profiler.php
ShortcodeParser.php
TextParser.php
XML.php
subpackage model
Boolean.php
ComponentSet.php
CompositeDBField.php
Currency.php
CurrentPageIdentifier.php
Database.php
DatabaseAdmin.php
DataObject.php
DataObjectDecorator.php
DataObjectInterface.php
DataObjectLog.php
DataObjectSet.php
Date.php
Datetime.php
DB.php
DBField.php
Decimal.php
Double.php
Enum.php
Float.php
ForeignKey.php
Hierarchy.php
HTMLText.php
HTMLVarchar.php
Int.php
Money.php
MultiEnum.php
MySQLDatabase.php
Percentage.php
PrimaryKey.php
SiteTreeDecorator.php
SQLMap.php
SQLQuery.php
StringField.php
Text.php
Time.php
Transliterator.php
Varchar.php
Versioned.php
Year.php
subpackage parsers
SQLFormatter.php
subpackage search
AdvancedSearchForm.php
ContentControllerSearchExtension.php
EndsWithFilter.php
ExactMatchFilter.php
ExactMatchMultiFilter.php
FulltextFilter.php
FulltextSearchable.php
GreaterThanFilter.php
LessThanFilter.php
NegationFilter.php
PartialMatchFilter.php
SearchContext.php
SearchFilter.php
SearchForm.php
StartsWithFilter.php
StartsWithMultiFilter.php
SubstringFilter.php
WithinRangeFilter.php
subpackage security
Authenticator.php
BasicAuth.php
ChangePasswordForm.php
Group.php
GroupCsvBulkLoader.php
LoginAttempt.php
LoginForm.php
Member.php
MemberAuthenticator.php
MemberCsvBulkLoader.php
MemberLoginForm.php
MemberPassword.php
NZGovtPasswordValidator.php
PasswordEncryptor.php
PasswordValidator.php
Permission.php
PermissionCheckboxSetField.php
PermissionProvider.php
PermissionRole.php
PermissionRoleCode.php
RandomGenerator.php
Security.php
SecurityToken.php
subpackage tasks
EncryptAllPasswordsTask.php
i18nTextCollectorTask.php
MigrateSiteTreeLinkingTask.php
MigrateTranslatableTask.php
RemoveOrphanedPagesTask.php
UpgradeSiteTreePermissionSchemaTask.php
subpackage testing
CliTestReporter.php
FunctionalTest.php
InstallerTest.php
JSTestRunner.php
PhpUnitWrapper.php
SapphireTest.php
SapphireTestReporter.php
SapphireTestSuite.php
TestListener.php
TestOnly.php
TestRunner.php
TestSession.php
TestViewer.php
subpackage tools
CodeViewer.php
ModelViewer.php
subpackage validation
ValidationException.php
subpackage view
ArrayData.php
Requirements.php
SSViewer.php
ViewableData.php
subpackage widgets
Widget.php
WidgetArea.php

Class: Text

Source Location: /sapphire/core/model/fieldtypes/Text.php

Inheritance: Object < ViewableData < DBField < StringField < Text

Summary: Represents a variable-length string of up to 2 megabytes, designed to store raw text

Methods

public AbsoluteLinks ( ) Return the value of the field with relative links converted to absolute urls.
public BigSummary ( [$maxWords = 50], [$plain = 1] ) Performs the same function as the big summary, but doesnt trim new paragraphs off data.
public ContextSummary ( [$characters = 500], [$string = false], [$striphtml = true], [$highlight = true], [$prefix = "... "], [$suffix = "..."] ) Perform context searching to give some context to searches, optionally highlighting the search term.
public EscapeXML ( ) Return the value of the field with XML tags escaped.
public FirstParagraph ( [$plain = 1] ) Caution: Not XML/HTML-safe - does not respect closing tags.
public FirstSentence ( ) Caution: Not XML/HTML-safe - does not respect closing tags.
public LimitCharacters ( [$limit = 20], [$add = "..."] ) Limit this field's content by a number of characters.
public LimitSentences ( [$sentCount = 2] ) Limit sentences, can be controlled by passing an integer.
public LimitWordCount ( [$numWords = 26], [$add = '...'] ) Limit this field's content by a number of words.
public LimitWordCountXML ( [$numWords = 26], [$add = '...'] ) Limit the number of words of the current field's content. This is XML safe, so characters like & are converted to &amp;
public NoHTML ( ) Return the value of the field stripped of html tags
public Parse ( [$parser = "TextParser"] ) Allows a sub-class of TextParser to be rendered.
public requireField ( ) (non-PHPdoc)
public scaffoldFormField ( [$title = null], [$params = null] ) (non-PHPdoc)
public scaffoldSearchField ( [$title = null], [$params = null] ) (non-PHPdoc)
public Summary ( [$maxWords = 50] ) Caution: Not XML/HTML-safe - does not respect closing tags.

Show/hide inherited methods

Inherited Methods

public StringField::__construct()
public StringField::getNullifyEmpty()
public StringField::hasValue()
public StringField::Lower()
public StringField::prepValueForDB()
public StringField::setNullifyEmpty()
public StringField::setOptions()
public StringField::Upper()
public DBField::__construct()
public DBField::addToQuery()
public DBField::ATT()
public DBField::create()
public DBField::debug()
public DBField::defaultSearchFilter()
public DBField::exists()
public DBField::forTemplate()
public DBField::getName()
public DBField::getValue()
public DBField::hasValue()
public DBField::HTML()
public DBField::HTMLATT()
public DBField::JS()
public DBField::LowerCase()
public DBField::nullValue()
public DBField::prepValueForDB()
public DBField::RAW()
public DBField::RAWURLATT()
public DBField::requireField()
public DBField::saveInto()
public DBField::scaffoldFormField()
public DBField::scaffoldSearchField()
public DBField::setName()
public DBField::setTable()
public DBField::setValue()
public DBField::UpperCase()
public DBField::URLATT()
public DBField::writeToManipulation()
public DBField::XML()
public ViewableData::ATT_val()
public ViewableData::BaseHref()
public ViewableData::buildCastingCache()
public ViewableData::cachedCall()
public ViewableData::castingClass()
public ViewableData::castingHelper()
public ViewableData::castingHelperPair()
public ViewableData::castingObjectCreator()
public ViewableData::castingObjectCreatorPair()
public ViewableData::CSSClasses()
public ViewableData::CurrentMember()
public ViewableData::CurrentPage()
public ViewableData::customise()
public ViewableData::Debug()
public ViewableData::defineMethods()
public ViewableData::escapeTypeForField()
public ViewableData::Even()
public ViewableData::EvenOdd()
public ViewableData::First()
public ViewableData::FirstLast()
public ViewableData::getField()
public ViewableData::getIterator()
public ViewableData::getSecurityID()
public ViewableData::getXMLValues()
public ViewableData::hasField()
public ViewableData::HasPerm()
public ViewableData::hasValue()
public ViewableData::i18nLocale()
public ViewableData::IsAjax()
public ViewableData::iteratorProperties()
public ViewableData::JS_val()
public ViewableData::Last()
public ViewableData::Me()
public ViewableData::Middle()
public ViewableData::MiddleString()
public ViewableData::Modulus()
public ViewableData::MultipleOf()
public ViewableData::obj()
public ViewableData::Odd()
public ViewableData::Pos()
public ViewableData::RAW_val()
public ViewableData::renderWith()
public ViewableData::setCustomisedObj()
public ViewableData::setField()
public ViewableData::SQL_val()
public ViewableData::ThemeDir()
public ViewableData::Top()
public ViewableData::TotalItems()
public ViewableData::XML_val()
public ViewableData::__get()
public ViewableData::__isset()
public ViewableData::__set()
public Object::__construct()
protected Object::addMethodsFrom()
public Object::addStaticVars()
protected Object::addWrapperMethod()
public Object::add_extension()
public Object::add_static_var()
public Object::allMethodNames()
public Object::cacheToFile()
public Object::cacheToFileWithArgs()
public Object::clearCache()
public Object::combined_static()
public Object::create()
protected Object::createMethod()
public Object::create_from_string()
protected Object::defineMethods()
public Object::exists()
public Object::extend()
public Object::extInstance()
public Object::getCustomClass()
public Object::getExtensionInstance()
public Object::getExtensionInstances()
public Object::get_extensions()
public Object::get_static()
public Object::hasExtension()
public Object::hasMethod()
public Object::has_extension()
public Object::invokeWithExtensions()
public Object::is_a()
protected Object::loadCache()
public Object::parentClass()
public Object::parse_class_spec()
public Object::remove_extension()
protected Object::sanitiseCachename()
protected Object::saveCache()
public Object::set_stat()
public Object::set_static()
public Object::set_uninherited()
public Object::stat()
public Object::strong_create()
public Object::uninherited()
public Object::uninherited_static()
public Object::useCustomClass()
public Object::__call()
public Object::__toString()

Show/hide inherited variables

Constants

(none)

Child classes:

HTMLText
Represents a large text field that contains HTML content.


Class Details

Represents a variable-length string of up to 2 megabytes, designed to store raw text

Example definition via DataObject::$db:

  1.  static $db array(
  2.      "MyDescription" => "Text",
  3.  );

[ Top ]


Class Methods

public AbsoluteLinks

string AbsoluteLinks( )

[line 88]

Return the value of the field with relative links converted to absolute urls.

[ Top ]

public BigSummary

void BigSummary( [ $maxWords = 50], [ $plain = 1])

[line 210]

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.

Parameters:

  • $maxWords -
  • $plain -

[ Top ]

public ContextSummary

string ContextSummary( [int $characters = 500], [boolean $string = false], [boolean $striphtml = true], [boolean $highlight = true], [String $prefix = "... "], [String $suffix = "..."])

[line 286]

Perform context searching to give some context to searches, optionally highlighting the search term.

Parameters:

  • int $characters - Number of characters in the summary
  • boolean $string - Supplied string ("keywords")
  • boolean $striphtml - Strip HTML?
  • boolean $highlight - Add a highlight <span> element around search query?
  • String $prefix - prefix text
  • String $suffix - suffix

[ Top ]

public EscapeXML

string EscapeXML( )

[line 80]

Return the value of the field with XML tags escaped.

[ Top ]

public FirstParagraph

void FirstParagraph( [ $plain = 1])

[line 248]

Caution: Not XML/HTML-safe - does not respect closing tags.

Parameters:

  • $plain -

[ Top ]

public FirstSentence

void FirstSentence( )

[line 147]

Caution: Not XML/HTML-safe - does not respect closing tags.

Overridden in child classes as:
HTMLText::FirstSentence()

[ Top ]

public LimitCharacters

string LimitCharacters( [int $limit = 20], [string $add = "..."])

[line 101]

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.

Overridden in child classes as:
HTMLText::LimitCharacters()

Parameters:

  • int $limit - Number of characters to limit by
  • string $add - Ellipsis to add to the end of truncated string

[ Top ]

public LimitSentences

void LimitSentences( [int $sentCount = 2])

[line 124]

Limit sentences, can be controlled by passing an integer.

Parameters:

  • int $sentCount - The amount of sentences you want.

[ Top ]

public LimitWordCount

string LimitWordCount( [int $numWords = 26], [string $add = '...'])

[line 55]

Limit this field's content by a number of words.

CAUTION: This is not XML safe. Please use LimitWordCountXML() instead.

Parameters:

  • int $numWords - Number of words to limit by
  • string $add - Ellipsis to add to the end of truncated string

[ Top ]

public LimitWordCountXML

string LimitWordCountXML( [int $numWords = 26], [string $add = '...'])

[line 115]

Limit the number of words of the current field's content. This is XML safe, so characters like & are converted to &amp;

Parameters:

  • int $numWords - Number of words to limit by
  • string $add - Ellipsis to add to the end of truncated string

[ Top ]

public NoHTML

string NoHTML( )

[line 73]

Return the value of the field stripped of html tags

[ Top ]

public Parse

string Parse( [ $parser = "TextParser"])

[line 332]

Allows a sub-class of TextParser to be rendered.

  • @see TextParser for implementation details.

Parameters:

  • $parser -

[ Top ]

public requireField

void requireField( )

[line 40]

(non-PHPdoc)

Overrides DBField::requireField() (Add the field to the underlying database.)

[ Top ]

public scaffoldFormField

void scaffoldFormField( [ $title = null], [ $params = null])

[line 348]

(non-PHPdoc)

Overridden in child classes as:
HTMLText::scaffoldFormField()
Overrides DBField::scaffoldFormField() (Returns a FormField instance used as a default for form scaffolding.)

Parameters:

  • $title -
  • $params -

[ Top ]

public scaffoldSearchField

void scaffoldSearchField( [ $title = null], [ $params = null])

[line 362]

(non-PHPdoc)

Overridden in child classes as:
HTMLText::scaffoldSearchField()
Overrides DBField::scaffoldSearchField() (Returns a FormField instance used as a default for searchform scaffolding.)

Parameters:

  • $title -
  • $params -

[ Top ]

public Summary

void Summary( [ $maxWords = 50])

[line 163]

Caution: Not XML/HTML-safe - does not respect closing tags.

Overridden in child classes as:
HTMLText::Summary()

Parameters:

  • $maxWords -

[ Top ]


Class Variables

public $casting = array(
      "AbsoluteLinks" => "Text",
      "BigSummary" => "Text",
      "ContextSummary" => "Text",
      "FirstParagraph" => "Text",
      "FirstSentence" => "Text",
      "LimitCharacters" => "Text",
      "LimitSentences" => "Text",
      "Summary" => "Text",
      'EscapeXML' => 'Text',
      'LimitWordCount' => 'Text',
      'LimitWordCountXML' => 'HTMLText',
      'NoHTML' => 'Text',
   )

[line 21]

Type: mixed

Overrides: Array

[ Top ]

Comments

Comment policy: Please use comments for tips and corrections about the described functionality. Comments are moderated, we reserve the right to remove comments that are inappropriate or are no longer relevant.
Use the Silverstripe Forum to ask questions.

blog comments powered by Disqus

Documentation generated on Thu, 17 May 2012 04:04:49 +1200 by phpDocumentor 1.4.3