OXID eShop CE  4.10.2
 All Classes Namespaces Files Functions Variables Pages
oxBase Class Reference
+ Inheritance diagram for oxBase:
+ Collaboration diagram for oxBase:

Public Member Functions

 getUseSkipSaveFields ()
 setUseSkipSaveFields ($blUseSkipSaveFields)
 __construct ()
 __set ($sName, $sValue)
 __get ($sName)
 __isset ($mVar)
 __clone ()
 oxClone ($oObject)
 getUpdateSeo ()
 setUpdateSeo ($blUpdateSeo)
 init ($sTableName=null, $blForceAllFields=false)
 assign ($dbRecord)
 getClassName ()
 getCoreTableName ()
 getId ()
 setId ($sOXID=null)
 setShopId ($iShopId)
 getShopId ()
 getViewName ($blForceCoreTableUsage=null)
 modifyCacheKey ($sCacheKey, $blOverride=false)
 disableLazyLoading ()
 isDerived ()
 setIsDerived ($blVal)
 isMultilang ()
 load ($sOXID)
 isLoaded ()
 buildSelectString ($aWhere=null)
 assignRecord ($sSelect)
 getFieldData ($sFieldName)
 getSelectFields ($blForceCoreTableUsage=null)
 delete ($sOxId=null)
 save ()
 allowDerivedUpdate ()
 allowDerivedDelete ()
 exists ($sOXID=null)
 getSqlActiveSnippet ($blForceCoreTable=null)
 beforeUpdate ($sOXID=null)
 onChange ($iAction=null, $sOXID=null)
 setInList ()
 isOx ()
 isReadOnly ()
 setReadOnly ($blReadOnly)
 getFieldNames ()
 addFieldName ($sName)
 getLanguage ()
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

Protected Member Functions

 _setUpdateSeoOnFieldChange ($sField)
 _removeElement2ShopRelations ($sOxId)
 _isInList ()
 _getObjectViewName ($sTable, $sShopID=null)
 _getTableFields ($sTable, $blReturnSimple=false)
 _getAllFields ($blReturnSimple=false)
 _initDataStructure ($blForceFullStructure=false)
 _getNonCachedFieldNames ($blForceFullStructure=false)
 _getFieldStatus ($sFieldName)
 _addField ($sName, $iStatus, $sType=null, $sLength=null)
 _getFieldLongName ($sFieldName)
 _setFieldData ($sFieldName, $sValue, $iDataType=oxField::T_TEXT)
 _canFieldBeNull ($sFieldName)
 _getFieldDefaultValue ($sFieldName)
 _getUpdateFieldValue ($sFieldName, $oField)
 _getUpdateFields ($blUseSkipSaveFields=true)
 _update ()
 _insert ()
 _isDisabledFieldCache ()
 _addSkippedSaveFieldsForMapping ()
 _disableLazyLoadingForCaching ()

Protected Attributes

 $_sOXID = null
 $_iShopId = null
 $_blIsSimplyClonable = true
 $_sClassName = 'oxbase'
 $_sCoreTable = null
 $_sViewTable = null
 $_aFieldNames = array('oxid' => 0)
 $_sCacheKey = null
 $_blUseLazyLoading = false
 $_aSkipSaveFields = array('oxtimestamp')
 $_blUseSkipSaveFields = true
 $_sExistKey = 'oxid'
 $_blIsDerived = null
 $_blIsSeoObject = false
 $_blUpdateSeo = true
 $_blReadOnly = false
 $_blIsInList = false
 $_isLoaded = false
 $_aInnerLazyCache = null
 $_blEmployMultilanguage = false

Static Protected Attributes

static $_blDisableFieldCaching = array()
- Static Protected Attributes inherited from oxSuperCfg
static $_oConfig = null
static $_oSession = null
static $_oRights = null
static $_oActUser = null
static $_blIsAdmin = null

Detailed Description

Base class associated with database record

Definition at line 16 of file oxbase.php.

Constructor & Destructor Documentation

Member Function Documentation

oxBase::__clone ( )

Magic function invoked on object cloning. Basically takes care about cloning properly DB fields.

Definition at line 344 of file oxbase.php.

oxBase::__get (   $sName)

Magic getter for older versions and template variables

Parameters
string$sNamevariable name
Returns
mixed

Reimplemented in oxVoucher, oxArticle, oxOrder, oxUser, oxCategory, oxManufacturer, oxContent, and oxUserPayment.

Definition at line 247 of file oxbase.php.

oxBase::__isset (   $mVar)

Magic isset() handler. Workaround for detecting if protected properties are set.

Parameters
mixed$mVarSupplied class variable
Returns
bool

Definition at line 336 of file oxbase.php.

oxBase::__set (   $sName,
  $sValue 
)

Magic setter. If using lazy loading, adds setted field to fields array

Parameters
string$sNamename value
mixed$sValuevalue

Reimplemented in oxArticle.

Definition at line 225 of file oxbase.php.

oxBase::_addField (   $sName,
  $iStatus,
  $sType = null,
  $sLength = null 
)
protected

Adds additional field to meta structure

Parameters
string$sNameField name
int$iStatusField name status. In derived classes it indicates multi language status.
string$sTypeField type
string$sLengthField Length
Returns
null

Reimplemented in oxI18n.

Definition at line 1143 of file oxbase.php.

oxBase::_addSkippedSaveFieldsForMapping ( )
protected

Add additional fields to skipped save fields

Definition at line 1436 of file oxbase.php.

oxBase::_canFieldBeNull (   $sFieldName)
protected

check if db field can be null

Parameters
string$sFieldNamedb field name
Returns
bool

Reimplemented in oxI18n.

Definition at line 1247 of file oxbase.php.

oxBase::_disableLazyLoadingForCaching ( )
protected

Disable lazy loading if cache is enabled

Definition at line 1443 of file oxbase.php.

oxBase::_getAllFields (   $blReturnSimple = false)
protected

Returns meta field or simple array of all object fields. This method is slow and normally is called before field cache is built. Make sure it is not called after first page is loaded and cache data is fully built (until tmp dir is cleaned).

Parameters
bool$blReturnSimpleSet $blReturnSimple to true when you need simple array (meta data array is returned otherwise)
See Also
oxBase::_getTableFields()
Returns
array

Reimplemented in oxI18n.

Definition at line 1026 of file oxbase.php.

oxBase::_getFieldDefaultValue (   $sFieldName)
protected

returns default field value

Parameters
string$sFieldNamedb field name
Returns
mixed

Definition at line 1266 of file oxbase.php.

oxBase::_getFieldLongName (   $sFieldName)
protected

Returns long field name in "<table>__<field_name>" format.

Parameters
string$sFieldNameShort field name
Returns
string

Reimplemented in oxOrderFile.

Definition at line 1186 of file oxbase.php.

oxBase::_getFieldStatus (   $sFieldName)
protected

Returns _aFieldName[] value. 0 means - non multi language, 1 - multi language field. But this is defined only in derived oxi18n class. In oxBase it is always 0, as oxBase treats all fields as non multi language.

Parameters
string$sFieldNameField name
Returns
int

Reimplemented in oxI18n.

Definition at line 1128 of file oxbase.php.

oxBase::_getNonCachedFieldNames (   $blForceFullStructure = false)
protected

Returns the list of fields. This function is slower and its result is normally cached. Basically we have 3 separate cases here:

  1. We are in admin so we need extended info for all fields (name, field length and field type)
  2. Object is not lazy loaded so we will return all data fields as simple array, as we need only names
  3. Object is lazy loaded so we will return empty array as all fields are loaded on request (in __get()).
Parameters
bool$blForceFullStructureWhether to force loading of full data structure
Returns
array

Reimplemented in oxI18n.

Definition at line 1077 of file oxbase.php.

oxBase::_getObjectViewName (   $sTable,
  $sShopID = null 
)
protected

Returns actual object view or table name

Parameters
string$sTableOriginal table name
int$sShopIDShop ID
Returns
string

Reimplemented in oxI18n.

Definition at line 966 of file oxbase.php.

oxBase::_getTableFields (   $sTable,
  $blReturnSimple = false 
)
protected

Returns meta field or simple array of all object fields. This method is slow and normally is called before field cache is built. Make sure it is not called after first page is loaded and cache data is fully built (until tmp dir is cleaned).

Parameters
string$sTabletable name
bool$blReturnSimpleSet $blReturnSimple to true when you need simple array (meta data array is returned otherwise)
Returns
array

Definition at line 983 of file oxbase.php.

oxBase::_getUpdateFields (   $blUseSkipSaveFields = true)
protected

Get object fields sql part used for updates or inserts: return e.g. fldName1 = 'value1',fldName2 = 'value2'...

Parameters
bool$blUseSkipSaveFieldsforces usage of skip save fields array (default is true)
Returns
string

Reimplemented in oxI18n.

Definition at line 1316 of file oxbase.php.

oxBase::_getUpdateFieldValue (   $sFieldName,
  $oField 
)
protected

returns quoted field value for using in update statement

Parameters
string$sFieldNamename of field
oxField$oFieldfield object
Returns
string

Definition at line 1286 of file oxbase.php.

oxBase::_initDataStructure (   $blForceFullStructure = false)
protected

Initializes object data structure. Either by trying to load from cache or by calling $this->_getNonCachedFieldNames

Parameters
bool$blForceFullStructureSet to true if you want to load full structure in any case.

Definition at line 1041 of file oxbase.php.

oxBase::_insert ( )
protected

Insert this Object into the database, this function only works on the main table, it will not save any dependent tables, which might be loaded through oxlist.

Returns
bool

Reimplemented in oxArticle, oxUser, oxOrder, oxCategory, oxOrderArticle, oxI18n, oxNews, oxUserPayment, oxNewsSubscribed, oxPricealarm, oxReview, oxGbEntry, oxUserBasket, and oxRemark.

Definition at line 1385 of file oxbase.php.

oxBase::_isDisabledFieldCache ( )
protected

Checks if current class disables field caching. This method is primary used in unit tests.

Returns
bool

Definition at line 1423 of file oxbase.php.

oxBase::_isInList ( )
protected

Checks if this instance is one of oxList elements.

Returns
bool

Definition at line 953 of file oxbase.php.

oxBase::_removeElement2ShopRelations (   $sOxId)
protected

Removes relevant mapping data for selected object if it is a multishop inheritable table

Parameters
string$sOxIdObject ID

Definition at line 793 of file oxbase.php.

oxBase::_setFieldData (   $sFieldName,
  $sValue,
  $iDataType = oxField::T_TEXT 
)
protected

Sets data field value

Parameters
string$sFieldNameindex OR name (eg. 'oxarticles__oxtitle') of a data field to set
string$sValuevalue of data field
int$iDataTypefield type
Returns
null

Reimplemented in oxCategory, oxContent, oxNewsletter, oxOrderArticle, oxUserBasketItem, oxNews, oxStatistic, and oxLinks.

Definition at line 1206 of file oxbase.php.

oxBase::_setUpdateSeoOnFieldChange (   $sField)
protected

Checks whether certain field has changed, and sets update seo flag if needed. It can only set the value to false, so it allows for multiple calls to the method, and if atleast one requires seo update, other checks won't override that.

Parameters
string$sFieldField name that will be checked

Reimplemented in oxI18n.

Definition at line 400 of file oxbase.php.

oxBase::_update ( )
protected

Update this Object into the database, this function only works on the main table, it will not save any dependent tables, which might be loaded through oxlist.

Exceptions
oxObjectExceptionThrows on failure inserting
Returns
bool

Reimplemented in oxArticle, oxUser, oxOrder, oxCategory, oxI18n, oxUserPayment, oxNews, and oxNewsSubscribed.

Definition at line 1344 of file oxbase.php.

oxBase::addFieldName (   $sName)

Adds additional field name to meta structure

Parameters
string$sNameField name

Definition at line 1497 of file oxbase.php.

oxBase::allowDerivedDelete ( )

Checks if derived delete is allowed (calls oxbase::isDerived)

Returns
bool

Definition at line 860 of file oxbase.php.

oxBase::allowDerivedUpdate ( )

Checks if derived update is allowed (calls oxbase::isDerived)

Returns
bool

Reimplemented in oxUser.

Definition at line 850 of file oxbase.php.

oxBase::assign (   $dbRecord)

Assigns DB field values to object fields. Returns true on success.

Parameters
array$dbRecordAssociative data values array
Returns
null

Reimplemented in oxArticle, oxOrder, oxCategory, oxContent, oxManufacturer, oxOrderArticle, oxVendor, oxSimpleVariant, oxNews, oxGbEntry, and oxReview.

Definition at line 443 of file oxbase.php.

oxBase::assignRecord (   $sSelect)

Performs SQL query, assigns record field values to object. Returns true on success.

Parameters
string$sSelectSQL statement
Returns
bool

Definition at line 697 of file oxbase.php.

oxBase::beforeUpdate (   $sOXID = null)

This function is triggered before the record is updated. If you make any update to the database record manually you should also call beforeUpdate() from your script.

Parameters
string$sOXIDObject ID(default null). Pass the ID in case object is not loaded.

Definition at line 923 of file oxbase.php.

oxBase::buildSelectString (   $aWhere = null)

Builds and returns SQL query string.

Parameters
mixed$aWhereSQL select WHERE conditions array (default false)
Returns
string

Definition at line 671 of file oxbase.php.

oxBase::delete (   $sOxId = null)

Delete this object from the database, returns true on success.

Parameters
string$sOxIdObject ID(default null)
Returns
bool

Reimplemented in oxArticle, oxOrder, oxOrderArticle, oxI18n, oxUser, oxPayment, oxContent, oxManufacturer, oxUserBasket, oxDelivery, oxFile, oxVendor, oxCategory, oxRecommList, oxNews, oxMediaUrl, oxSelectlist, oxActions, oxNewsletter, oxDiscount, oxAttribute, oxVoucherSerie, oxGroups, and oxDeliverySet.

Definition at line 759 of file oxbase.php.

oxBase::disableLazyLoading ( )

Disables lazy loading mechanism and init object fully

Definition at line 593 of file oxbase.php.

oxBase::exists (   $sOXID = null)

Checks if this object exists, returns true on success.

Parameters
string$sOXIDObject ID(default null)
Returns
bool

Reimplemented in oxUser.

Definition at line 872 of file oxbase.php.

oxBase::getClassName ( )

Returns object class name

Returns
string

Definition at line 471 of file oxbase.php.

oxBase::getCoreTableName ( )

Return object core table name

Returns
string

Definition at line 481 of file oxbase.php.

oxBase::getFieldData (   $sFieldName)

Gets field data

Parameters
string$sFieldNamename (eg. 'oxtitle') of a data field to get
Returns
mixed value of a data field

Definition at line 718 of file oxbase.php.

oxBase::getFieldNames ( )

Returns array with object field names

Returns
array

Definition at line 1487 of file oxbase.php.

oxBase::getId ( )

Returns unique object id.

Returns
string

Definition at line 491 of file oxbase.php.

oxBase::getLanguage ( )

Returns -1, means object is not multi language

Returns
int

Reimplemented in oxOrderArticle, and oxI18n.

Definition at line 1509 of file oxbase.php.

oxBase::getSelectFields (   $blForceCoreTableUsage = null)

Function builds the field list used in select.

Parameters
bool$blForceCoreTableUsage(optional) use core views
Returns
string

Definition at line 732 of file oxbase.php.

oxBase::getShopId ( )

Return original object shop id

Returns
int

Definition at line 539 of file oxbase.php.

oxBase::getSqlActiveSnippet (   $blForceCoreTable = null)

Returns SQL select string with checks if items are available

Parameters
bool$blForceCoreTableforces core table usage (optional)
Returns
string

Reimplemented in oxArticle, and oxCategory.

Definition at line 895 of file oxbase.php.

oxBase::getUpdateSeo ( )

Returns update seo flag

Returns
boolean

Definition at line 378 of file oxbase.php.

oxBase::getUseSkipSaveFields ( )

Getting use skip fields or not

Returns
bool

Definition at line 178 of file oxbase.php.

oxBase::getViewName (   $blForceCoreTableUsage = null)

Returns main table data is actually selected from (could be a view name as well)

Parameters
bool$blForceCoreTableUsage(optional) use core views
Returns
string

Definition at line 551 of file oxbase.php.

oxBase::init (   $sTableName = null,
  $blForceAllFields = false 
)

Sets the names to main and view tables, loads metadata of each table.

Parameters
string$sTableNameName of DB object table
bool$blForceAllFieldsForces initialisation of all fields overriding lazy loading functionality

Definition at line 422 of file oxbase.php.

oxBase::isDerived ( )

Returns true in case the item represented by this object is derived from parent shop

Returns
bool

Definition at line 605 of file oxbase.php.

oxBase::isLoaded ( )

Returns object "loaded" state

Returns
bool

Definition at line 659 of file oxbase.php.

oxBase::isMultilang ( )

Returns true, if object has multi language fields (if object is derived from oxi18n class). In oxBase it is always returns false, as oxBase treats all fields as non multi language.

Returns
bool

Reimplemented in oxI18n.

Definition at line 627 of file oxbase.php.

oxBase::isOx ( )

Checks if object ID's first two chars are 'o' and 'x'. Returns true or false

Returns
bool

Definition at line 1452 of file oxbase.php.

oxBase::isReadOnly ( )

Is object readonly

Returns
bool

Definition at line 1467 of file oxbase.php.

oxBase::load (   $sOXID)

Loads object data from DB (object data ID is passed to method). Returns true on success. could throw oxObjectException F ?

Parameters
string$sOXIDObject ID
Returns
bool

Reimplemented in oxArticle, oxUser, oxCategory, oxManufacturer, oxUserPayment, oxVendor, oxArticleTagList, oxReview, oxNewsSubscribed, and oxRemark.

Definition at line 641 of file oxbase.php.

oxBase::modifyCacheKey (   $sCacheKey,
  $blOverride = false 
)

Lazy loading cache key modifier.

Parameters
string$sCacheKeycache key
bool$blOverridemarker to force override cache key

Reimplemented in oxI18n.

Definition at line 581 of file oxbase.php.

oxBase::onChange (   $iAction = null,
  $sOXID = null 
)

This function is triggered whenever the object is saved or deleted. onChange() is triggered after saving the changes in Save() method, after deleting the instance from the database. If you make any change to the database record manually you should also call onChange() from your script.

Parameters
int$iActionAction identifier.
string$sOXIDObject ID(default null). Pass the ID in case object is not loaded.

Definition at line 935 of file oxbase.php.

oxBase::oxClone (   $oObject)

Clone this object - similar to Copy Constructor.

Parameters
object$oObjectObject to copy

Definition at line 361 of file oxbase.php.

oxBase::save ( )

Save this Object to database, insert or update as needed.

Returns
string|bool

Reimplemented in oxArticle, oxOrder, oxOrderArticle, oxRecommList, oxUser, oxContent, oxArticleTagList, and oxObject2Group.

Definition at line 803 of file oxbase.php.

oxBase::setId (   $sOXID = null)

Sets unique object id

Parameters
string$sOXIDRecord ID
Returns
string

Reimplemented in oxArticle.

Definition at line 503 of file oxbase.php.

oxBase::setInList ( )

Sets item as list element

Definition at line 943 of file oxbase.php.

oxBase::setIsDerived (   $blVal)

Returns true in case the item represented by this object is derived from parent shop

Parameters
bool$blValif derived

Definition at line 616 of file oxbase.php.

oxBase::setReadOnly (   $blReadOnly)

Set object readonly

Parameters
bool$blReadOnlyreadonly flag

Definition at line 1477 of file oxbase.php.

oxBase::setShopId (   $iShopId)

Sets original object shop ID

Parameters
int$iShopIdNew shop ID

Reimplemented in oxOrderFile.

Definition at line 529 of file oxbase.php.

oxBase::setUpdateSeo (   $blUpdateSeo)

Sets update seo flag

Parameters
boolean$blUpdateSeo

Definition at line 388 of file oxbase.php.

oxBase::setUseSkipSaveFields (   $blUseSkipSaveFields)

Setting use skip fields or not

Parameters
bool$blUseSkipSaveFields- true or false

Definition at line 188 of file oxbase.php.

Member Data Documentation

oxBase::$_aFieldNames = array('oxid' => 0)
protected

Definition at line 67 of file oxbase.php.

oxBase::$_aInnerLazyCache = null
protected

Definition at line 163 of file oxbase.php.

oxBase::$_aSkipSaveFields = array('oxtimestamp')
protected

Definition at line 88 of file oxbase.php.

oxBase::$_blDisableFieldCaching = array()
staticprotected

Definition at line 121 of file oxbase.php.

oxBase::$_blEmployMultilanguage = false
protected

Definition at line 170 of file oxbase.php.

oxBase::$_blIsDerived = null
protected

Definition at line 110 of file oxbase.php.

oxBase::$_blIsInList = false
protected

Definition at line 149 of file oxbase.php.

oxBase::$_blIsSeoObject = false
protected

Definition at line 128 of file oxbase.php.

oxBase::$_blIsSimplyClonable = true
protected

Definition at line 38 of file oxbase.php.

oxBase::$_blReadOnly = false
protected

Definition at line 142 of file oxbase.php.

oxBase::$_blUpdateSeo = true
protected

Definition at line 135 of file oxbase.php.

oxBase::$_blUseLazyLoading = false
protected

Definition at line 81 of file oxbase.php.

oxBase::$_blUseSkipSaveFields = true
protected

Definition at line 95 of file oxbase.php.

oxBase::$_iShopId = null
protected

Definition at line 31 of file oxbase.php.

oxBase::$_isLoaded = false
protected

Definition at line 156 of file oxbase.php.

oxBase::$_sCacheKey = null
protected

Definition at line 74 of file oxbase.php.

oxBase::$_sClassName = 'oxbase'
protected

Definition at line 45 of file oxbase.php.

oxBase::$_sCoreTable = null
protected

Definition at line 52 of file oxbase.php.

oxBase::$_sExistKey = 'oxid'
protected

Definition at line 102 of file oxbase.php.

oxBase::$_sOXID = null
protected

Definition at line 24 of file oxbase.php.

oxBase::$_sViewTable = null
protected

Definition at line 59 of file oxbase.php.


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