Public Member Functions | |
__construct ($value=null, $type=self::T_TEXT) | |
__isset ($sName) | |
__get ($sName) | |
__toString () | |
convertToFormattedDbDate () | |
convertToPseudoHtml () | |
setValue ($value=null, $type=self::T_TEXT) | |
getRawValue () | |
Public Attributes | |
const | T_TEXT = 1 |
const | T_RAW = 2 |
Protected Member Functions | |
_initValue ($value=null, $type=self::T_TEXT) |
Database field description object.
when a value is requested from oxField, it either takes 'value' field or 'rawValue' (depending which one is available). In case 'rawValue' is taken, it is escaped first before returning.
T_RAW and T_TEXT types represent not the assignment logic, but rather a returned value escaping status.
Definition at line 14 of file oxfield.php.
oxField.__construct | ( | $ | value = null , |
|
$ | type = self::T_TEXT | |||
) |
Constructor Initial value assigment is coded here by not calling a function is for performance because oxField is created MANY times and even a function call matters
if T_RAW is used, then it fills $value, because this is the value, that does not need to be escaped and is by definition equal to $rawValue (which is not set for less memory usage).
if T_TEXT is used, then $rawValue is assigned and retrieved $value (which is not set initially) is escaped $rawValue.
e.g. > if your input is "<b>string</b>" and you want your output to be exactly same, you should use T_RAW - in this way it will be assigned to $value property as the result. > if your input is "1 & (a < b)" and you want your output to be escaped, you should use T_TEXT - in this way it will be assigned to $rawValue property and it will be escaped.
mixed | $value Field value | |
int | $type Value type |
Definition at line 52 of file oxfield.php.
oxField.__get | ( | $ | sName | ) |
Magic getter
string | $sName Variable name |
Definition at line 95 of file oxfield.php.
oxField.__isset | ( | $ | sName | ) |
Checks if $name is set
string | $sName Variable name |
Definition at line 74 of file oxfield.php.
oxField.__toString | ( | ) |
oxField._initValue | ( | $ | value = null , |
|
$ | type = self::T_TEXT | |||
) | [protected] |
Initial field value
mixed | $value Field value | |
int | $type Value type |
Definition at line 152 of file oxfield.php.
oxField.convertToFormattedDbDate | ( | ) |
Converts to formatted db date
Definition at line 133 of file oxfield.php.
oxField.convertToPseudoHtml | ( | ) |
Converts to pseudo html - new lines to
tags
Definition at line 141 of file oxfield.php.
oxField.getRawValue | ( | ) |
oxField.setValue | ( | $ | value = null , |
|
$ | type = self::T_TEXT | |||
) |
Sets field value and type
mixed | $value Field value | |
int | $type Value type |
Definition at line 170 of file oxfield.php.
const oxField.T_RAW = 2 |
escaping functionality type: expected value is not escaped (raw) text.
Definition at line 25 of file oxfield.php.
const oxField.T_TEXT = 1 |
escaping functionality type: expected value is escaped text.
Definition at line 20 of file oxfield.php.