OXID eShop CE  6.1.5
OxidEsales\EshopCommunity\Core\Field Class Reference
+ Collaboration diagram for OxidEsales\EshopCommunity\Core\Field:

Public Member Functions

 __construct ($value=null, $type=self::T_TEXT)
 
 __isset ($name)
 
 __get ($name)
 
 __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.

Constructor & Destructor Documentation

◆ __construct()

OxidEsales\EshopCommunity\Core\Field::__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

Member Function Documentation

◆ __get()

OxidEsales\EshopCommunity\Core\Field::__get (   $name)

Magic getter

Parameters
string$nameVariable name
Returns
string | null

◆ __isset()

OxidEsales\EshopCommunity\Core\Field::__isset (   $name)

Checks if $name is set

Parameters
string$nameVariable name
Returns
boolean

◆ __toString()

OxidEsales\EshopCommunity\Core\Field::__toString ( )

Returns actual field value

Returns
string

◆ _initValue()

OxidEsales\EshopCommunity\Core\Field::_initValue (   $value = null,
  $type = self::T_TEXT 
)
protected

Initial field value

Parameters
mixed$valueField value
int$typeValue type

◆ convertToFormattedDbDate()

OxidEsales\EshopCommunity\Core\Field::convertToFormattedDbDate ( )

Converts to formatted db date

◆ convertToPseudoHtml()

OxidEsales\EshopCommunity\Core\Field::convertToPseudoHtml ( )

Converts to pseudo html - new lines to
tags

◆ getRawValue()

OxidEsales\EshopCommunity\Core\Field::getRawValue ( )

Return raw value

Returns
string

◆ setValue()

OxidEsales\EshopCommunity\Core\Field::setValue (   $value = null,
  $type = self::T_TEXT 
)

Sets field value and type

Parameters
mixed$valueField value
int$typeValue type

Member Data Documentation

◆ T_RAW

const OxidEsales\EshopCommunity\Core\Field::T_RAW = 2

escaping functionality type: expected value is not escaped (raw) text.

◆ T_TEXT

const OxidEsales\EshopCommunity\Core\Field::T_TEXT = 1

escaping functionality type: expected value is escaped text.


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