Webylon 3.1 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • auth
  • Booking
  • cart
    • shipping
    • steppedcheckout
  • Catalog
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • ArrayData
  • CalendarWidget
  • DataObjectManagerAction
  • LiveCalendarWidget
  • MonthNavigator
  • Requirements
  • Requirements_Backend
  • SSViewer
  • SSViewer_Cached_PartialParser
  • SSViewer_FromString
  • SSViewer_PartialParser
  • ViewableData
  • ViewableData_Customised
  • ViewableData_Debugger

Class ViewableData

A ViewableData object is any object that can be rendered into a template/view.

A view interrogates the object being currently rendered in order to get data to render into the template. This data is provided and automatically escaped by ViewableData. Any class that needs to be available to a view (controllers, DataObjects, page controls) should inherit from this class.

Object
Extended by ViewableData implements IteratorAggregate

Direct known subclasses

Aggregate, ArrayData, DBField, Email, Form_FieldMap, LiveCalendarWidget, ModelViewer_Field, ModelViewer_Model, ModelViewer_Relation, MonthNavigator, NestedForm, RecipientImportField_Cell, BulkLoader, RequestHandler, RestfulService, RSSFeed, RSSFeed_Entry, SideReportView, SimpleOrderButton, SS_HTMLValue, SS_Report, TableListField_Item, TabularStyle, CalendarWidget, Versioned_Version, ViewableData_Customised, ViewableData_Debugger, CartOrderButton, DashboardPlugin, DataDifferencer, DataObject, DataObjectManagerAction, DataObjectSet

Indirect known subclasses

AdditionalMenuWidget, AdditionalMenuWidget_Item, AnnouncementHolder, CustomPayment, DailyTask, DashboardAdmin, DatabaseAdmin, DatalessField, DataObjectFileTracking, DataObjectManager, DataObjectManager_Controller, DataObjectManager_Item, DataObjectManager_ItemRequest, AnnouncementHolder_Controller, DataObjectManager_Popup, Date, DateField, DateField_Disabled, DatePickerField, DatePickerField_Controller, DatetimeField, DatetimeField_Readonly, DBLocale, Decimal, AssetAdmin, DeleteEmptyAssociatedFoldersTask, DeleteUnconfirmTask, DevelopmentAdmin, DocPage, DocPage_Controller, DocumentDirection, DocumentHaving, DocumentItem, DocumentPage_File, DocumentPageFiles_Manager, AssetManager, DocumentSearchForm, DocumentsPage, DocumentsPage_Controller, DocumentType, Double, DropdownField, EditableCheckbox, EditableCheckboxGroupField, EditableCountryDropdownField, EditableDateField, AssetTableField, EditableDropdown, EditableEmailField, EditableFileField, EditableFormField, EditableFormHeading, EditableHiddenField, EditableLiteralField, EditableMemberListField, EditableMultipleOptionField, EditableOption, AuthFormWidget, EditableRadioField, EditableSiteAgreementField, EditableSpamProtectionField, EditableTextField, Email_BounceHandler, Email_BounceRecord, EmailField, Enum, ErrorPage, ErrorPage_Controller, AutoCompleteField, Event, Event_Controller, EventCalendarWidget, EventHolder, EventHolder_Controller, FaqAdmin, FaqHolder, FaqHolder_Controller, FAQHomepageWidget, FaqQuestion, AutocompleteTextField, FaqSection, FaqSection_Controller, FAQSidebarWidget, FavoriteProductsSidebarWidget, FeedbackHomepageWidget, FieldEditor, FieldGroup, FieldSet, File, FileComplexTableField, BannerWidget, FileDataObjectManager, FileDataObjectManager_Controller, FileDataObjectManager_Item, FileDataObjectManager_ItemRequest, FileDataObjectManager_Popup, FileField, FileIFrameField, FileList, FindCyrillic, FindCyrillic_Controller, BannerWidget_Item, FixedShippingMethod, Float, FLV, Folder, Folder_UnusedAssetsField, ForeignKey, Form, FormAction, FormAction_WithoutLabel, FormField, Address, BaseObjectCategory, GoogleSitemap, Group, GroupCsvBulkLoader, GroupedDropdownField, GroupImportForm, Guestbook, Guestbook_Controller, GuestbookAdmin, GuestbookAdmin_CollectionController, GuestbookEntry, BatchProcess_Controller, GuestbookWidget, HasManyComplexTableField, HasManyComplexTableField_Item, HasManyDataObjectManager, HasManyDataObjectManager_Item, HasManyFileDataObjectManager, HasManyFileDataObjectManager_Item, HasOneComplexTableField, HasOneComplexTableField_Item, HasOneDataObjectManager, BigFilesReport, HasOneDataObjectManager_Item, HasOneFileDataObjectManager, HasOneFileDataObjectManager_Item, HeaderField, HiddenField, HiddenFieldSet, HomePage, HomePage_Controller, HomepageWidget, HomepageWidgetArea, BookingAdminPage, HourlyTask, HTMLBlockHomepageWidget, HTMLBlockSidebarWidget, HTMLDropdownField, HtmlEditorField, HtmlEditorField_Readonly, HtmlEditorField_Toolbar, HTMLText, HTMLVarchar, Image, BookingAdminPage_Controller, Image_Cached, ImageAssetManager, ImageDataObjectManager, ImageDataObjectManager_Item, ImageDataObjectManager_ItemRequest, ImageDataObjectManager_Popup, ImageEditor, ImageField, ImageFormAction, ImportAdmin, BookingOrder, ImportAdmin_CollectionController, ImportAutoStartTask, ImportLog, ImportLog_Item, ImportTask, InlineFormAction, InlineFormAction_ReadOnly, InstallerTest, Int, JSTestRunner, BookingOrder_StatusLog, LabelField, LanguageDropdownField, LastDoc_Controller, LeftAndMain, ListboxField, LiteralField, LiveCalendarWidget_Controller, LoggerAdmin, LoggerAdmin_CollectionController, LoggerAdmin_RecordController, BookingOrderAdmin, LoginAttempt, LoginForm, LogItem, LookupField, ManyManyComplexTableField, ManyManyComplexTableField_Item, ManyManyDataObjectManager, ManyManyDataObjectManager_Item, ManyManyFileDataObjectManager, ManyManyFileDataObjectManager_Item, BookingOrderAdmin_CollectionController, MapObject, MapObject_Controller, MapObjectGroup, MapObjectGroup_Controller, MapPage, MapPage_Controller, Material3D_File, Mediaweb3DPageFiles_Manager, MediawebForm, MediawebPage, BookingPage, MediawebPage_Controller, MediawebPage_File, MediawebPage_Image, MediawebPage_Photo, MediawebPage_Popup, MediawebPageFiles_Manager, MediawebPagePhoto_Manager, MediawebPageTexture_Manager, Member, Member_ChangePasswordEmail, AdvancedSearchForm, BookingPage_Controller, Member_ForgotPasswordEmail, Member_GroupSet, Member_ProfileForm, Member_SignupEmail, MemberCsvBulkLoader, MemberImportForm, MemberLoginForm, MemberPassword, MemberTableField, MemberTableField_Item, BookingPaymentMethod, MemberTableField_ItemRequest, MemberTableField_Popup, ModelAdmin, ModelAdmin_CollectionController, ModelAdmin_RecordController, ModelAsController, ModelViewer, ModelViewer_Module, Money, MoneyField, BookingService, MonthlyTask, MP3, MultiEnum, MultiUploadControls, MultiUploadField, NewDocumentsAdmin, News_Controller, NewsArchive, NewsEntry, NewsEntry_Controller, Boolean, NewsHolder, NewsHolder_Controller, Newsletter, Newsletter_Email, Newsletter_Recipient, Newsletter_SentRecipient, NewsletterAdmin, NewsletterEmailBlacklist, NewsletterList, NewsletterType, BouncedList, NewsLiveCalendarWidget, NonUsedFilesReport, NullableField, NumericField, OptionsetField, Order, Order_CancelForm, Order_StatusLog, OrderAdmin, OrderAdmin_CollectionController, BrokenLinksReport, OrderAdmin_RecordController, OrderDataObject, OrderExporter, OrderItem, OrderItemField, Orders1CExchange_Controller, OrderService, OrderServiceOrder, Page, Page_Controller, ButtonsBlockHomepageWidget, PageComment, PageComment_Controller, PageCommentInterface, PageCommentInterface_Controller, PageCommentInterface_Form, PageMenuWidget, PasswordField, Payment, Payment_Handler, PaymentAdmin, ButtonsBlockHomepageWidget_Item, PaymentAdmin_CollectionController, PaymentMethod, PaymentType, PayPalPayment, PayPalPayment_Handler, Percentage, Permission, PermissionCheckboxSetField, PermissionCheckboxSetField_Readonly, PermissionRole, CallBackWidget, PermissionRoleCode, PhoneField, PhoneNumberField, PhotoAlbumHomepageWidget, PhotoAlbumItem, PhotoAlbumManager, PhotoAlbumManager_Controller, PhotoAlbumManager_Popup, PhotoAlbumPage, PhotoAlbumPage_Controller, CarouselHomepageWidget, PhotoGalleryHomepageWidget, PhotoGalleryHomepageWidget_Item, PhotoGalleryPage, PhotoGalleryPage_Controller, PhotoGalleryWidget, PhpCaptchaField, Poll, PollAnswer, PollPage, PollSidebarWidget, AdvancedSliderHomepageWidget, CarouselHomepageWidget_Item, PostVKNotificationQueueTask, PriceListWidget, PrimaryKey, PrintableTransformation_TabSet, Product, Product_Controller, ProductSearchPage, ProductSearchPage_Controller, ProfilePage, ProfilePage_Controller, Cart_Controller, ProgressBar, PublHolder, PublHolder_Controller, Publication, Publication_Controller, PublicationWidget, QuarterHourlyTask, QueuedEmail, QueuedEmailDispatchTask, RangeField, CartPage, RatePeriod, RatingDataObject, RatingExtension_Controller, ReadonlyField, RealtyImportAdmin, RealtyImportAdmin_CollectionController, RealtyImportLog, RealtyImportLog_Item, RealtyXMLImportTask, RebuildStaticCacheTask, CartPage_Controller, RecentComments, RecentFiles, RecentPages, RecipientExportField, RecipientImportField, RecipientImportField_UploadForm, RedirectEntry, RedirectEntry_Admin, RedirectorPage, RedirectorPage_Controller, CartTableListField, RegionRestriction, RegistrationPage, RegistrationPage_Controller, RelatedPageLink, RemoveOrphanedPagesTask, RepairImportTask, ReportAdmin, ResetFormAction, RestfulServer, RestrictedTextField, CartTableListField_Item, RestrictionRegionCountryDropdownField, Room, Room_Controller, RoomCatalog, RoomCatalog_Controller, RoomOrder, RoomOrderPerson, RoomRate, RoomRate_PriceField, RoomService, CartWidget, RoomServiceAdmin, RoomServiceDropdownField, RoomServiceOrder, RootURLController, SapphireInfo, SapphireREPL, SapphireSoapServer, SberbankPayment, SberbankPayment_Handler, ScaffoldingComplexTableField_Popup, Catalog, ScheduledTask, Search_Controller, SearchForm, SearchWidget, Security, SecurityAdmin, SelectionGroup, SeparateHomepageWidget, SeparateSidebarWidget, ServiceOrder, Catalog_Controller, ShippingMethod, ShippingMethodAdmin, ShippingMethodAdmin_CollectionController, ShopCountry, ShowPoll, SidebarWidget, SidebarWidgetArea, SideReport_BrokenFiles, SideReport_BrokenLinks, SideReport_BrokenRedirectorPages, CatalogAdmin, SideReport_BrokenVirtualPages, SideReport_EmptyPages, SideReport_RecentlyEdited, SideReport_ToDo, SideReportWrapper, SimpleHTMLEditorField, SimpleImageField, SimpleImageField_Disabled, SimpleOrderData, SimpleOrderPage, AdvancedSliderHomepageWidget_Item, CatalogAdmin_CollectionController, SimpleOrderPage_Controller, SimpleTinyMCEField, SimpleTreeDropdownField, SimpleWysiwygField, SiteConfig, SiteInfo, SiteMap_Controller, SiteTree, SiteTreeMaintenanceTask, SliderHomepageWidget, CatalogAdmin_RecordController, SliderHomepageWidget_Item, SOAPModelAccess, SpamProtectorField, SpecialCatalog, SpecialCatalog_Controller, SpecialCatalogHomepageWidget, SpecialCatalogSidebarWidget, SS_Datetime, SS_ReportWrapper, StartCatalog, CatalogFilterSidebarWidget, StartCatalog_Controller, StateDropdownField, StateProvinceDropdownField, StaticExporter, StealthFieldCaptcha, StringField, SubmittedFileField, SubmittedForm, SubmittedFormField, SubmittedFormReportField, CatalogImportTask, SubpageListField, SubpageListField_Item, SubPageListField_ItemRequest, SubscribeForm, SubscribeForm_Controller, SubscribeWidget, SubsectionMenuWidget, Subsite, Subsite_Template, SubsiteAdmin, CatalogPrice, SubsiteAdmin_CollectionController, SubsiteAgnosticTableListField, SubsiteDomain, SubsiteDropdownField, SubsiteReportWrapper, SubsitesSelectorPage, SubsitesSelectorPage_Controller, SubsitesTreeDropdownField, SubsitesVirtualPage, SubsitesVirtualPage_Controller, CatalogRubricsHomepageWidget, Tab, TableField, TableField_Item, TableListField, TableListField_ItemRequest, TableShippingMethod, TableShippingRate, TabSet, TaskRunner, TestRunner, ChangePasswordForm, TestViewer, Text, TextAnonsWidget, TextAnonsWidget_Item, TextareaField, TextBlockHomepageWidget, TextBlockSidebarWidget, TextField, TextFieldWithEmptyFlag, TextLiteralField, CheckboxField, Texture3D_File, ThumbnailStripField, Time, TimeField, TimeField_Readonly, ToggleCompositeField, ToggleField, TreeDropdownField, TreeDropdownField_Readonly, TreeMultiselectField, CheckboxField_Disabled, TreeMultiselectField_Readonly, TreeSelectorField, UniqueRestrictedTextField, UniqueTextField, UnitellerPayment, UnitellerPayment_Handler, UnmoderatedComments, Unsubscribe_Controller, Unsubscribe_MailingListForm, UnsubscribedList, CheckboxField_Readonly, UnsubscribeRecord, Upload, UserDefinedForm, UserDefinedForm_Controller, UserDefinedForm_EmailRecipient, UserDefinedForm_SubmittedFormEmail, Varchar, VersionedRestfulServer, VideoBankPage, VideoBankPage_Controller, Aggregate_Relationship, CheckboxSetField, VideoCategory, VideoEntry, VideoFile, VideoManager, VirtualPage, VirtualPage_Controller, VirtualProduct, VirtualProduct_Controller, VKNotificationQueue, VKNotificationQueueAdmin, CheckoutPage, WeatherSidebarWidget, WebylonImportAdmin, WebylonNews, WebylonWidget, WebylonWidget_Item, WebylonWidgetArea, WeeklyTask, WeightTableShippingMethod, WeightTableShippingRate, Widget, CheckoutPage_Controller, Widget_Controller, Widget_TreeDropdownField, WidgetAdmin, WidgetArea, WidgetAreaEditor, YaMoneyPayment, YaMoneyPayment_Handler, YandexMapsHomepageWidget, YandexMapsWidget, Year, ChequePayment, YearlyTask, YMLExporter, ChequePayment_Handler, CliController, CMSActionOptionsForm, CMSBatchActionHandler, CMSMain, CodeViewer, AjaxUniqueTextField, CommentAdmin, CommentTableField, CommentTableField_Item, ComplexTableField, ComplexTableField_Item, ComplexTableField_ItemRequest, ComplexTableField_Popup, ComponentSet, CompositeField, ConfirmedPasswordField, Announcement, ConsultantWidget, ContactsBlockWidget, ContactsPage, ContactsPage_Controller, ContentController, Controller, CorrectBadFoldersTask, CostTableShippingMethod, CostTableShippingRate, CountryDropdownField, Announcement_Controller, CreditCardField, CsvBulkLoader, Currency, CurrencyField, CurrencyField_Disabled, CurrencyField_Readonly, CurrencyWidget, CustomMenuAdmin, CustomMenuHolder, CustomMenuItem

Package: sapphire\view
Located at sapphire/core/ViewableData.php

Methods summary

public static string
# castingObjectCreator( string $fieldSchema )

Converts a field spec into an object creator. For example: "Int" becomes "new Int($fieldName);" and "Varchar(50)" becomes "new Varchar($fieldName, 50);".

Converts a field spec into an object creator. For example: "Int" becomes "new Int($fieldName);" and "Varchar(50)" becomes "new Varchar($fieldName, 50);".

Parameters

$fieldSchema
string $fieldSchema The field spec

Returns

string
string
public static array
# castingObjectCreatorPair( string $fieldSchema )

Convert a field schema (e.g. "Varchar(50)") into a casting object creator array that contains both a className and castingHelper constructor code. See ViewableData::castingObjectCreator() for more information about the constructor.

Convert a field schema (e.g. "Varchar(50)") into a casting object creator array that contains both a className and castingHelper constructor code. See ViewableData::castingObjectCreator() for more information about the constructor.

Parameters

$fieldSchema
string $fieldSchema

Returns

array
array
public boolean
# __isset( string $property )

Check if a field exists on this object or its failover.

Check if a field exists on this object or its failover.

Parameters

$property
string $property

Returns

boolean
bool
public mixed
# __get( string $property )

Get the value of a property/field on this object. This will check if a method called get{$property} exists, then check if a field is available using ViewableData::getField(), then fall back on a failover object.

Get the value of a property/field on this object. This will check if a method called get{$property} exists, then check if a field is available using ViewableData::getField(), then fall back on a failover object.

Parameters

$property
string $property

Returns

mixed
mixed
public
# __set( string $property, mixed $value )

Set a property/field on this object. This will check for the existence of a method called set{$property}, then use the ViewableData::setField() method.

Set a property/field on this object. This will check for the existence of a method called set{$property}, then use the ViewableData::setField() method.

Parameters

$property
string $property
$value
mixed $value
public boolean
# hasField( string $field )

Check if a field exists on this object. This should be overloaded in child classes.

Check if a field exists on this object. This should be overloaded in child classes.

Parameters

$field
string $field

Returns

boolean
bool
public mixed
# getField( string $field )

Get the value of a field on this object. This should be overloaded in child classes.

Get the value of a field on this object. This should be overloaded in child classes.

Parameters

$field
string $field

Returns

mixed
mixed
public
# setField( string $field, mixed $value )

Set a field on this object. This should be overloaded in child classes.

Set a field on this object. This should be overloaded in child classes.

Parameters

$field
string $field
$value
mixed $value
public
# defineMethods( )

Add methods from the ViewableData::$failover object, as well as wrapping any methods prefixed with an underscore into a ViewableData::cachedCall().

Add methods from the ViewableData::$failover object, as well as wrapping any methods prefixed with an underscore into a ViewableData::cachedCall().

Overrides

Object::defineMethods
public ViewableData_Customised
# customise( array|ViewableData $data )

Merge some arbitrary data in with this object. This method returns a ViewableData_Customised instance with references to both this and the new custom data.

Merge some arbitrary data in with this object. This method returns a ViewableData_Customised instance with references to both this and the new custom data.

Note that any fields you specify will take precedence over the fields on this object.

Parameters

$data
array|ViewableData $data

Returns

ViewableData_Customised
ViewableData_Customised
public
# setCustomisedObj( ViewableData $object )

Parameters

$object
ViewableData $object
public array
# castingHelperPair( string $field )

Get the class a field on this object would be casted to, as well as the casting helper for casting a field to an object (see ViewableData::castingHelper() for information on casting helpers).

Get the class a field on this object would be casted to, as well as the casting helper for casting a field to an object (see ViewableData::castingHelper() for information on casting helpers).

The returned array contains two keys: - className: the class the field would be casted to (e.g. "Varchar") - castingHelper: the casting helper for casting the field (e.g. "return new Varchar($fieldName)")

Parameters

$field
string $field

Returns

array
array
public string
# castingHelper( string $field )

Return the "casting helper" (a piece of PHP code that when evaluated creates a casted value object) for a field on this object.

Return the "casting helper" (a piece of PHP code that when evaluated creates a casted value object) for a field on this object.

Parameters

$field
string $field

Returns

string
string
public string
# castingClass( string $field )

Get the class name a field on this object will be casted to

Get the class name a field on this object will be casted to

Parameters

$field
string $field

Returns

string
string
public string
# escapeTypeForField( string $field )

Return the string-format type for the given field.

Return the string-format type for the given field.

Parameters

$field
string $field

Returns

string
'xml'|'raw'
public
# buildCastingCache( reference & $cache )

Save the casting cache for this object (including data from any failovers) into a variable

Save the casting cache for this object (including data from any failovers) into a variable

Parameters

$cache
reference $cache
public string
# renderWith( string|array|SSViewer $template, array $customFields = null )

Render this object into the template, and get the result as a string. You can pass one of the following as the $template parameter:
- a template name (e.g. Page)
- an array of possible template names - the first valid one will be used
- an SSViewer instance

Render this object into the template, and get the result as a string. You can pass one of the following as the $template parameter: - a template name (e.g. Page) - an array of possible template names - the first valid one will be used - an SSViewer instance

Parameters

$template
string|array|SSViewer $template the template to render into
$customFields
array $customFields fields to customise() the object with before rendering

Returns

string
string
public
# obj( string $fieldName, array $arguments = null, boolean $forceReturnedObject = true, string $cache = false, mixed $cacheName = null )

Get the value of a field on this object, automatically inserting the value into any available casting objects that have been specified.

Get the value of a field on this object, automatically inserting the value into any available casting objects that have been specified.

Parameters

$fieldName
string $fieldName
$arguments
array $arguments
$forceReturnedObject
bool $forceReturnedObject if TRUE, the value will ALWAYS be casted to an object before being returned, even if there is no explicit casting information
$cache
string $cacheName a custom cache name
$cacheName
public
# cachedCall( string $field, array $arguments = null, string $identifier = null )

A simple wrapper around ViewableData::obj() that automatically caches the result so it can be used again without re-running the method.

A simple wrapper around ViewableData::obj() that automatically caches the result so it can be used again without re-running the method.

Parameters

$field
string $field
$arguments
array $arguments
$identifier
string $identifier an optional custom cache identifier
public boolean
# hasValue( string $field, array $arguments = null, boolean $cache = true )

Checks if a given method/field has a valid value. If the result is an object, this will return the result of the exists method, otherwise will check if the result is not just an empty paragraph tag.

Checks if a given method/field has a valid value. If the result is an object, this will return the result of the exists method, otherwise will check if the result is not just an empty paragraph tag.

Parameters

$field
string $field
$arguments
array $arguments
$cache
bool $cache

Returns

boolean
bool
public string
# XML_val( string $field, array $arguments = null, boolean $cache = false )

Get the string value of a field on this object that has been suitable escaped to be inserted directly into a template.

Get the string value of a field on this object that has been suitable escaped to be inserted directly into a template.

Parameters

$field
string $field
$arguments
array $arguments
$cache
bool $cache

Returns

string
string
public string
# RAW_val( string $field, array $arguments = null, boolean $cache = true )

Return the value of the field without any escaping being applied.

Return the value of the field without any escaping being applied.

Parameters

$field
string $field
$arguments
array $arguments
$cache
bool $cache

Returns

string
string
public string
# SQL_val( string $field, array $arguments = null, boolean $cache = true )

Return the value of a field in an SQL-safe format.

Return the value of a field in an SQL-safe format.

Parameters

$field
string $field
$arguments
array $arguments
$cache
bool $cache

Returns

string
string
public string
# JS_val( string $field, array $arguments = null, boolean $cache = true )

Return the value of a field in a JavaScript-save format.

Return the value of a field in a JavaScript-save format.

Parameters

$field
string $field
$arguments
array $arguments
$cache
bool $cache

Returns

string
string
public string
# ATT_val( string $field, array $arguments = null, boolean $cache = true )

Return the value of a field escaped suitable to be inserted into an XML node attribute.

Return the value of a field escaped suitable to be inserted into an XML node attribute.

Parameters

$field
string $field
$arguments
array $arguments
$cache
bool $cache

Returns

string
string
public array
# getXMLValues( array $fields )

Get an array of XML-escaped values by field name

Get an array of XML-escaped values by field name

Parameters

$fields
array $elements an array of field names

Returns

array
array
public ArrayIterator
# getIterator( )

Return a single-item iterator so you can iterate over the fields of a single record.

Return a single-item iterator so you can iterate over the fields of a single record.

This is useful so you can use a single record inside a <% control %> block in a template - and then use to access individual fields on this object.

Returns

ArrayIterator
ArrayIterator

Implementation of

IteratorAggregate::getIterator()
public
# iteratorProperties( integer $pos, integer $totalItems )

Set the current iterator properties - where we are on the iterator.

Set the current iterator properties - where we are on the iterator.

Parameters

$pos
int $pos position in iterator
$totalItems
int $totalItems total number of items
public boolean
# First( )

Returns true if this object is the first in a set.

Returns true if this object is the first in a set.

Returns

boolean
bool
public boolean
# Last( )

Returns true if this object is the last in a set.

Returns true if this object is the last in a set.

Returns

boolean
bool
public string|null
# FirstLast( )

Returns 'first' or 'last' if this is the first or last object in the set.

Returns 'first' or 'last' if this is the first or last object in the set.

Returns

string|null
string|null
public boolean
# Middle( )

Return true if this object is between the first & last objects.

Return true if this object is between the first & last objects.

Returns

boolean
bool
public string|null
# MiddleString( )

Return 'middle' if this object is between the first & last objects.

Return 'middle' if this object is between the first & last objects.

Returns

string|null
string|null
public boolean
# Even( )

Return true if this object is an even item in the set.

Return true if this object is an even item in the set.

Returns

boolean
bool
public boolean
# Odd( )

Return true if this is an odd item in the set.

Return true if this is an odd item in the set.

Returns

boolean
bool
public string
# EvenOdd( )

Return 'even' or 'odd' if this object is in an even or odd position in the set respectively.

Return 'even' or 'odd' if this object is in an even or odd position in the set respectively.

Returns

string
string
public integer
# Pos( integer $startIndex = 1 )

Return the numerical position of this object in the container set. The count starts at $startIndex.

Return the numerical position of this object in the container set. The count starts at $startIndex.

Parameters

$startIndex
int $startIndex Number to start count from.

Returns

integer
int
public integer
# TotalItems( )

Return the total number of "sibling" items in the dataset.

Return the total number of "sibling" items in the dataset.

Returns

integer
int
public integer
# Modulus( integer $mod, integer $startIndex = 1 )

Returns the modulus of the numerical position of the item in the data set. The count starts from $startIndex, which defaults to 1.

Returns the modulus of the numerical position of the item in the data set. The count starts from $startIndex, which defaults to 1.

Parameters

$mod
int $Mod The number to perform Mod operation to.
$startIndex
int $startIndex Number to start count from.

Returns

integer
int
public
# MultipleOf( mixed $factor, mixed $offset = 1 )
public ViewableData
# Me( )

When rendering some objects it is necessary to iterate over the object being rendered, to do this, you need access to itself.

When rendering some objects it is necessary to iterate over the object being rendered, to do this, you need access to itself.

Returns

ViewableData
ViewableData
public string
# ThemeDir( string $subtheme = false )

Return the directory if the current active theme (relative to the site root).

Return the directory if the current active theme (relative to the site root).

This method is useful for things such as accessing theme images from your template without hardcoding the theme page - e.g. <img src="$ThemeDir/images/something.gif">.

This method should only be used when a theme is currently active. However, it will fall over to the current project directory.

Parameters

$subtheme
string $subtheme the subtheme path to get

Returns

string
string
public string
# ThemeName( )

Возвращает имя текущей темы

Возвращает имя текущей темы

Если текущая тема не выбрана то возвращается site

Returns

string
string
public string
# CSSClasses( string $stopAtClass = 'ViewableData' )

Get part of the current classes ancestry to be used as a CSS class.

Get part of the current classes ancestry to be used as a CSS class.

This method returns an escaped string of CSS classes representing the current classes ancestry until it hits a stop point - e.g. "Page DataObject ViewableData".

Parameters

$stopAtClass
string $stopAtClass the class to stop at (default: ViewableData)

Returns

string
string

Uses

ClassInfo
public
# CurrentMember( )

See

Member::currentUser()
public string
# getSecurityID( )

Return a CSRF-preventing ID to insert into a form.

Return a CSRF-preventing ID to insert into a form.

Returns

string
string
public
# HasPerm( mixed $code )

See

Permission::check()
public
# BaseHref( )

See

Director::absoluteBaseURL()
public
# IsAjax( )

See

Director::is_ajax()
public
# i18nLocale( )

See

i18n::get_locale()
public ViewableData_Debugger
# Debug( )

Return debug information about this object that can be rendered into a template

Return debug information about this object that can be rendered into a template

Returns

ViewableData_Debugger
ViewableData_Debugger
public
# CurrentPage( )

See

Controller::curr()
public
# Top( )

See

SSViewer::topLevel()
public
# ColumnCalc( mixed $col )
public
# ColumnNumber( mixed $col )
public
# ColumnPos( mixed $col )
public
# ColumnBreak( mixed $col )
public
# ColumnPad( mixed $col )

Methods inherited from Object

__call(), __construct(), __toString(), __wakeup(), addMethodsFrom(), addStaticVars(), addWrapperMethod(), add_extension(), add_static_var(), allMethodNames(), cacheToFile(), cacheToFileWithArgs(), clearCache(), combined_static(), create(), createMethod(), create_from_string(), exists(), 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:

An array of objects to cast certain fields to. This is set up as an array in the format:

public static $casting = array (
    'FieldName' => 'ClassToCastTo(Arguments)'
);
public static string $default_cast
#

The default object to cast scalar fields to if casting information is not specified, and casting to an object is required.

The default object to cast scalar fields to if casting information is not specified, and casting to an object is required.

protected integer $iteratorPos
#
protected mixed $iteratorTotalItems
#
protected ViewableData $failover
#

A failover object to attempt to get data from if it is not present on this object.

A failover object to attempt to get data from if it is not present on this object.

protected ViewableData $customisedObject
#

Properties inherited from Object

$class, $extension_instances, $extensions

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.1 API Docs API documentation generated by ApiGen 2.8.0