Public Member Functions | |
__construct () | |
__set ($sName, $sValue) | |
__get ($sName) | |
__isset ($mVar) | |
__clone () | |
oxClone ($oObject) | |
init ($sTableName=null, $blForceAllFields=false) | |
assign ($dbRecord) | |
getClassName () | |
getCoreTableName () | |
getId () | |
setId ($sOXID=null) | |
setShopId ($iShopId) | |
getShopId () | |
getViewName () | |
modifyCacheKey ($sCacheKey, $blOverride=false) | |
disableLazyLoading () | |
setForceCoreTableUsage ($blForceCoreTableUsage) | |
setDisableShopCheck ($blDisableShopCheck) | |
isDerived () | |
setIsDerived ($blVal) | |
isMultilang () | |
load ($sOXID) | |
buildSelectString ($aWhere=null) | |
assignRecord ($sSelect) | |
getFieldData ($sFieldName) | |
getSelectFields () | |
delete ($sOXID=null) | |
save () | |
exists ($sOXID=null) | |
getSqlFieldName ($sField) | |
getSqlActiveSnippet ($blForceCoreTable=false) | |
validate () | |
beforeUpdate ($sOXID=null) | |
onChange ($iAction=null, $sOXID=null) | |
hasErrors () | |
getErrors () | |
getError ($sField) | |
getHtmlError ($sField) | |
Protected Member Functions | |
_getObjectViewName ($sTable, $sShopID=null) | |
_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) | |
_getUpdateFieldValue ($sFieldName, $oField) | |
_getUpdateFields ($blUseSkipSaveFields=true) | |
_update () | |
_insert () | |
_rebuildCache () | |
_setRecordNumber ($sMaxField, $aWhere=null, $iMaxTryCnt=5) | |
_isDisabledFieldCache () | |
Protected Attributes | |
$_sOXID = null | |
$_iShopId = null | |
$_blIsSimplyClonable = true | |
$_aErrors = array() | |
$_sClassName = 'oxbase' | |
$_sCoreTable = null | |
$_sViewTable = null | |
$_aFieldNames = array('oxid' => 0) | |
$_blIsNewCache = false | |
$_sCacheKey = null | |
$_blUseLazyLoading = false | |
$_aSkipSaveFields = array() | |
$_sExistKey = "oxid" | |
$_blIsDerived = null | |
$_blIsSeoObject = false | |
Static Protected Attributes | |
static | $_blDisableFieldCaching = array() |
oxBase.__construct | ( | ) |
Class constructor, sets active shop.
Reimplemented in oxActions, oxAttribute, oxCategory, oxContent, oxCountry, oxDelivery, oxDeliverySet, oxDiscount, oxGbEntry, oxGroups, oxI18n, oxLinks, oxMediaUrl, oxNews, oxNewsletter, oxNewsSubscribed, oxObject2Group, oxOrder, oxPayment, oxPricealarm, oxRecommList, oxRemark, oxShop, oxStatistic, oxUser, oxUserBasket, oxUserBasketItem, oxUserPayment, oxVendor, oxVoucher, oxVoucherSerie, and oxWrapping.
oxBase.__set | ( | $ | sName, | |
$ | sValue | |||
) |
Magic setter. If using lazy loading, adds setted field to fields array
string | $sName | |
mixed | $sValue |
oxBase.__get | ( | $ | sName | ) |
Magic getter for older versions and template variables
string | $sName variable name |
Reimplemented in oxCategory, oxContent, oxOrder, oxUser, oxUserPayment, oxVendor, and oxWrapping.
oxBase.__isset | ( | $ | mVar | ) |
Magic isset() handler. Workaround for detecting if protected properties are set.
mixed | $mVar Supplied class variable |
oxBase.__clone | ( | ) |
Magic fuinction invoked on object cloning. Basically takes care about cloning properly DB fields.
oxBase.oxClone | ( | $ | oObject | ) |
Clone this object - similar to Copy Constructor.
object | $oObject Object to copy |
oxBase.init | ( | $ | sTableName = null , |
|
$ | blForceAllFields = false | |||
) |
Sets the names to main and view tables, loads metadata of each table.
string | $sTableName Name of DB object table | |
bool | $blForceAllFields Forces initialisation of all fields overriding lazy loading functionality |
oxBase.assign | ( | $ | dbRecord | ) |
Assigns DB field values to object fields. Returns true on success.
array | $dbRecord Associative data values array |
Reimplemented in oxCategory, oxContent, oxGbEntry, oxI18n, oxNews, oxOrder, oxVendor, and oxWrapping.
oxBase.getClassName | ( | ) |
Returns object class name
oxBase.getCoreTableName | ( | ) |
Return object core table name
oxBase.getId | ( | ) |
Returns unique object id.
oxBase.setId | ( | $ | sOXID = null |
) |
Sets unique object id
string | $sOXID Record ID |
oxBase.setShopId | ( | $ | iShopId | ) |
Sets original object shop ID
int | $iShopId New shop ID |
oxBase.getShopId | ( | ) |
Return original object shop id
oxBase.getViewName | ( | ) |
Returns main table data is actually selected from (could be a view name as well)
oxBase.modifyCacheKey | ( | $ | sCacheKey, | |
$ | blOverride = false | |||
) |
Lazy loading cache key modifier.
string | $sCacheKey kache key | |
bool | $blOverride marker to force override cache key |
Reimplemented in oxI18n.
oxBase.disableLazyLoading | ( | ) |
Disables lazy loading mechanism and inits object fully
oxBase.setForceCoreTableUsage | ( | $ | blForceCoreTableUsage | ) |
Sets $this->_blForceCoreTableUsage property. Set it to true if you want to disable db view usage and select object records from core table (from all shops).
bool | $blForceCoreTableUsage New value |
oxBase.setDisableShopCheck | ( | $ | blDisableShopCheck | ) |
Set $this->_blDisableShopCheck class variable.
bool | $blDisableShopCheck New value |
oxBase.isDerived | ( | ) |
Returns true in case the item represented by this object is derived from parent shop
oxBase.setIsDerived | ( | $ | blVal | ) |
Returns true in case the item represented by this object is derived from parent shop
bool | $blVal |
oxBase.isMultilang | ( | ) |
oxBase.load | ( | $ | sOXID | ) |
Loads object data from DB (object data ID is passed to method). Returns true on success. could throw oxObjectException F ?
string | $sOXID Object ID |
Reimplemented in oxI18n, oxNewsSubscribed, oxRemark, oxUser, and oxUserPayment.
oxBase.buildSelectString | ( | $ | aWhere = null |
) |
Builds and returns SQL query string.
mixed | $aWhere SQL select WHERE conditions array (default false) |
oxBase.assignRecord | ( | $ | sSelect | ) |
Performs SQL query, assigns record field values to object. Returns true on success.
string | $sSelect SQL statement |
oxBase.getFieldData | ( | $ | sFieldName | ) |
Gets field data
string | $sFieldName name (eg. 'oxtitle') of a data field to get |
oxBase.getSelectFields | ( | ) |
Function builds the field list used in select.
oxBase.delete | ( | $ | sOXID = null |
) |
Delete this object from the database, returns true on success.
string | $sOXID Object ID(default null) |
Reimplemented in oxActions, oxAttribute, oxCategory, oxDelivery, oxDeliverySet, oxDiscount, oxGroups, oxMediaUrl, oxNews, oxNewsletter, oxOrder, oxPayment, oxRecommList, oxSelectlist, oxUser, oxUserBasket, and oxVoucherSerie.
oxBase.save | ( | ) |
Save this Object to database, insert or update as needed.
Reimplemented in oxObject2Group, oxOrder, and oxUser.
oxBase.exists | ( | $ | sOXID = null |
) |
Checks if this object exists, returns true on success.
string | $sOXID Object ID(default null) |
Reimplemented in oxUser.
oxBase.getSqlFieldName | ( | $ | sField | ) |
Returns field name. This method is actually used in oxi18n.
string | $sField Field name |
Reimplemented in oxI18n.
oxBase.getSqlActiveSnippet | ( | $ | blForceCoreTable = false |
) |
Returns SQL select string with checks if items are available
bool | $blForceCoreTable forces core table usage (optional) |
Reimplemented in oxCategory, and oxI18n.
oxBase.validate | ( | ) |
Checks if methods, stored in _aIdx2FldName array exists in running object methods collection. Returns true if method exists.
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.
string | $sOXID Object ID(default null). Pass the ID in case object is not loaded. |
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, but before actually deleting the instance from the database. If you make any change to the database record manually you should also call onChange() from your script.
int | $iAction Action identifier. | |
string | $sOXID Object ID(default null). Pass the ID in case object is not loaded. |
oxBase.hasErrors | ( | ) |
Returns number of errors.
oxBase.getErrors | ( | ) |
Returns an errors array.
oxBase.getError | ( | $ | sField | ) |
Returns error description of false if error field unavailable.
string | $sField name of error |
oxBase.getHtmlError | ( | $ | sField | ) |
Returns errors if available.
string | $sField name of error |
oxBase._getObjectViewName | ( | $ | sTable, | |
$ | sShopID = null | |||
) | [protected] |
Returns actual object view or table name
string | $sTable Original table name | |
int | $sShopID Shop ID |
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).
bool | $blReturnSimple Set $blReturnSimple to true when you need simple array (meta data array is returned otherwise) |
oxBase._initDataStructure | ( | $ | blForceFullStructure = false |
) | [protected] |
Initilizes object data structure. Either by trying to load from cache or by calling $this->_getNonCachedFieldNames
bool | $blForceFullStructure Set to true if you want to load full structure in any case. |
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 nede only names 3. Object is lazy loaded so we will return empty array as all fields are loaded on request (in __get()).
bool | $blForceFullStructure Whether to force loading of full data structure |
Reimplemented in oxI18n.
oxBase._getFieldStatus | ( | $ | sFieldName | ) | [protected] |
oxBase._addField | ( | $ | sName, | |
$ | iStatus, | |||
$ | sType = null , |
|||
$ | sLength = null | |||
) | [protected] |
Adds additional field to meta structure
string | $sName Field name | |
int | $iStatus Field name status. In derived classes it indicates multilanguage status. | |
string | $sType Field type | |
string | $sLength Field Length |
oxBase._getFieldLongName | ( | $ | sFieldName | ) | [protected] |
Returns long field name in "<table>__<field_name>" format.
string | $sFieldName Short field name |
oxBase._setFieldData | ( | $ | sFieldName, | |
$ | sValue, | |||
$ | iDataType = oxField::T_TEXT | |||
) | [protected] |
Sets data field value
string | $sFieldName index OR name (eg. 'oxarticles__oxtitle') of a data field to set | |
string | $sValue value of data field | |
int | $iDataType field type |
Reimplemented in oxCategory, oxContent, oxLinks, oxNews, oxNewsletter, oxStatistic, and oxUserBasketItem.
oxBase._getUpdateFieldValue | ( | $ | sFieldName, | |
$ | oField | |||
) | [protected] |
returns quoted field value for using in update statement
string | $sFieldName name of field | |
oxField | $oField field object |
oxBase._getUpdateFields | ( | $ | blUseSkipSaveFields = true |
) | [protected] |
Get object fields sql part used for updates or inserts: return e.g. fldName1 = 'value1',fldName2 = 'value2'...
bool | $blUseSkipSaveFields forces usage of skip save fields array (default is true) |
oxBase._update | ( | ) | [protected] |
Update this Object into the database, this function only works on the main table, it will not save any dependend tables, which might be loaded through oxlist.
oxObjectException | Throws on failure inserting |
Reimplemented in oxCategory, oxI18n, oxNews, oxNewsSubscribed, oxOrder, oxUser, and oxUserPayment.
oxBase._insert | ( | ) | [protected] |
Insert this Object into the database, this function only works on the main table, it will not save any dependend tables, which might be loaded through oxlist.
Reimplemented in oxCategory, oxGbEntry, oxNews, oxNewsSubscribed, oxOrder, oxPricealarm, oxRemark, oxUser, oxUserBasket, and oxUserPayment.
oxBase._rebuildCache | ( | ) | [protected] |
Clears Smarty cache data.
oxBase._setRecordNumber | ( | $ | sMaxField, | |
$ | aWhere = null , |
|||
$ | iMaxTryCnt = 5 | |||
) | [protected] |
Tries to fetch and set next record number in DB. Returns true on success
string | $sMaxField field name where record number is stored | |
string | $aWhere where condition array | |
int | $iMaxTryCnt max number of tryouts |
Reimplemented in oxUser.
oxBase._isDisabledFieldCache | ( | ) | [protected] |
Checks if current class disables field caching. This method is primary used in unit tests.
oxBase.$_sOXID = null [protected] |
oxBase.$_iShopId = null [protected] |
oxBase.$_blIsSimplyClonable = true [protected] |
oxBase.$_aErrors = array() [protected] |
oxBase.$_sClassName = 'oxbase' [protected] |
Reimplemented in oxActions, oxAttribute, oxCategory, oxContent, oxCountry, oxDelivery, oxDeliverySet, oxDiscount, oxGbEntry, oxGroups, oxI18n, oxLinks, oxMediaUrl, oxNews, oxNewsletter, oxNewsSubscribed, oxObject2Group, oxOrder, oxPayment, oxPricealarm, oxRecommList, oxRemark, oxSelectlist, oxShop, oxStatistic, oxUser, oxUserBasket, oxUserBasketItem, oxUserPayment, oxVendor, oxVoucher, oxVoucherSerie, and oxWrapping.
oxBase.$_sCoreTable = null [protected] |
oxBase.$_sViewTable = null [protected] |
oxBase.$_aFieldNames = array('oxid' => 0) [protected] |
oxBase.$_blIsNewCache = false [protected] |
oxBase.$_sCacheKey = null [protected] |
oxBase.$_blUseLazyLoading = false [protected] |
Reimplemented in oxCategory.
oxBase.$_aSkipSaveFields = array() [protected] |
Reimplemented in oxContent, oxOrder, oxRemark, and oxUserBasket.
oxBase.$_sExistKey = "oxid" [protected] |
oxBase.$_blIsDerived = null [protected] |
oxBase.$_blDisableFieldCaching = array() [static, protected] |
oxBase.$_blIsSeoObject = false [protected] |
Reimplemented in oxCategory, oxContent, and oxVendor.