OXID eShop CE  4.10.8
 All Classes Namespaces Files Functions Variables Pages
oxField Class Reference
+ Collaboration diagram for oxField:

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)

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
mixed$valueField value
int$typeValue type
Returns
null

Definition at line 52 of file oxfield.php.

Member Function Documentation

oxField::__get (   $sName)

Magic getter

Parameters
string$sNameVariable name
Returns
string | null

Definition at line 95 of file oxfield.php.

oxField::__isset (   $sName)

Checks if $name is set

Parameters
string$sNameVariable name
Returns
boolean

Definition at line 74 of file oxfield.php.

oxField::__toString ( )

Returns actual field value

Returns
string

Definition at line 125 of file oxfield.php.

oxField::_initValue (   $value = null,
  $type = self::T_TEXT 
)
protected

Initial field value

Parameters
mixed$valueField value
int$typeValue 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 ( )

Return raw value

Returns
string

Definition at line 182 of file oxfield.php.

oxField::setValue (   $value = null,
  $type = self::T_TEXT 
)

Sets field value and type

Parameters
mixed$valueField value
int$typeValue type

Definition at line 170 of file oxfield.php.

Member Data Documentation

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.


The documentation for this class was generated from the following file: