Class DBField
Single field in the database. Every field from the database is represented as a sub-class of DBField.
Multi-value DBField objects
Sometimes you will want to make DBField classes that don't have a 1-1 match to database fields. To do this, there are a number of fields for you to overload. - OverloadDBField::writeToManipulation() to add the appropriate references to the
INSERT or UPDATE command - Overload DBField::addToQuery() to add the appropriate
items to a SELECT query's field list - Add appropriate accessor methods
- Object
-
ViewableData
implements
IteratorAggregate
-
DBField
Direct known subclasses
Boolean,
Date,
Year,
Decimal,
Double,
Enum,
Float,
Int,
Money,
StringField,
Time
Indirect known subclasses
CatalogPrice,
Currency,
SS_Datetime,
Text,
Varchar,
DBLocale,
ForeignKey,
HTMLText,
HTMLVarchar,
MultiEnum,
Percentage,
PrimaryKey,
ShopCountry
Methods summary
public
|
|
public static
|
|
public
|
|
public
string
|
|
public
mixed
|
|
public
|
|
public
boolean
|
|
public
boolean
|
|
public
string
|
#
prepValueForDB( mixed $value )
Return an encoding of the given value suitable for inclusion in a SQL statement. If necessary, this should include quotes. |
public
|
#
writeToManipulation( array & $manipulation )
Prepare the current field for usage in a database-manipulation (works on a manipulation reference). |
public
|
#
addToQuery(
Add custom query parameters for this field, mostly SELECT statements for multi-value fields. |
public
|
|
public
string
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
string
|
|
public
string
|
|
public
|
|
public
|
|
public
|
#
scaffoldFormField( string $title = null )
Returns a FormField instance used as a default for form scaffolding. |
public
|
#
scaffoldSearchField( string $title = null )
Returns a FormField instance used as a default for searchform scaffolding. |
public
|
|
abstract public
|
|
public
|
Methods inherited from ViewableData
ATT_val(),
BaseHref(),
CSSClasses(),
ColumnBreak(),
ColumnCalc(),
ColumnNumber(),
ColumnPad(),
ColumnPos(),
CurrentMember(),
CurrentPage(),
Debug(),
Even(),
EvenOdd(),
First(),
FirstLast(),
HasPerm(),
IsAjax(),
JS_val(),
Last(),
Me(),
Middle(),
MiddleString(),
Modulus(),
MultipleOf(),
Odd(),
Pos(),
RAW_val(),
SQL_val(),
ThemeDir(),
ThemeName(),
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(),
__wakeup(),
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
protected
mixed
|
$value | |
protected
mixed
|
$tableName | |
protected
mixed
|
$name | |
protected
mixed
|
$arrayValue | |
public static
string
|
$escape_type |
#
The escape type for this field when inserted into a template - either "xml" or "raw". |
public static
string
|
$default_search_filter_class |
#
Subclass of |
protected
mixed
|
$defaultVal |
#
mixed Default-value in the database. Might be overridden on DataObject-level, but still useful for setting defaults on already existing records after a db-build. |
Properties inherited from ViewableData
$casting,
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems