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

Public Member Functions

 oxNew ($sClassName)
 resetInstanceCache ($sClassName=null)
 generateUId ()
 getClassName ($sClassName)
 getShopId ()
 getModuleVar ($sModuleVarName)
 setModuleVar ($sModuleVarName, $aValues)

Static Public Member Functions

static getInstance ()
static setClassInstance ($sClassName, $oInstance)
static resetClassInstances ()
static resetModuleVars ()

Public Attributes

const CACHE_FILE_PREFIX = "config"

Protected Member Functions

 _getObject ($sClassName, $iArgCnt, $aParams)
 _getActiveModuleChain ($aClassChain)
 _disableModule ($sModule)
 _makeSafeModuleClassParents ($aClassChain, $sBaseModule)
 _getConfKey ()
 _getShopUrlMap ()
 _getCacheDir ()
 _getCacheFileName ($sModuleVarName, $sShopId=null)
 _getModuleVarFromDB ($sModuleVarName)
 _getFromCache ($sModuleVarName, $blSubshopSpecific=true)
 _setToCache ($sVarName, $sValue, $blSubshopSpecific=true)

Protected Attributes

 $_aClassNameCache = array()

Static Protected Attributes

static $_aLoadedArticles = array()
static $_aInstanceCache = array()
static $_aModuleVars = array()
static $_aClassInstances = array()

Static Private Attributes

static $_instance = null

Detailed Description

Object Factory implementation (oxNew() method is implemented in this class).

Definition at line 9 of file oxutilsobject.php.

Member Function Documentation

oxUtilsObject::_disableModule (   $sModule)
protected

Disables module, adds to aDisabledModules config.

Parameters
array$sModuleModule name

Definition at line 346 of file oxutilsobject.php.

oxUtilsObject::_getActiveModuleChain (   $aClassChain)
protected

Checks if module is disabled, added to aDisabledModules config.

Parameters
array$aClassChainModule names
Returns
array

Definition at line 311 of file oxutilsobject.php.

oxUtilsObject::_getCacheDir ( )
protected

Gets cache directory

Returns
string

Definition at line 574 of file oxutilsobject.php.

oxUtilsObject::_getCacheFileName (   $sModuleVarName,
  $sShopId = null 
)
protected

Returns module file cache name.

Parameters
string$sModuleVarNameModule variable name
int$sShopIdShop id
Returns
string

Definition at line 589 of file oxutilsobject.php.

oxUtilsObject::_getConfKey ( )
protected

Returns configuration key. This method is independent from oxConfig functionality.

Returns
string

Definition at line 502 of file oxutilsobject.php.

oxUtilsObject::_getFromCache (   $sModuleVarName,
  $blSubshopSpecific = true 
)
protected

Returns shop module variable value from cache. This method is independent from oxConfig class and does not use database.

Parameters
string$sModuleVarNameModule variable name
bool$blSubshopSpecificIndicates should cache be shop specific or not
Returns
string

Definition at line 637 of file oxutilsobject.php.

oxUtilsObject::_getModuleVarFromDB (   $sModuleVarName)
protected

Returns shop module variable value directly from database.

Parameters
string$sModuleVarNameModule variable name
Returns
string

Definition at line 611 of file oxutilsobject.php.

oxUtilsObject::_getObject (   $sClassName,
  $iArgCnt,
  $aParams 
)
protected

Creates object with dynamic constructor parameters. If parameter count > 5 - exception is thrown

Parameters
string$sClassNameclass name
int$iArgCntargument count
array$aParamsconstructor parameters
Exceptions
oxSystemComponentExceptionin case parameters count > 5
Returns
mixed

Definition at line 188 of file oxutilsobject.php.

oxUtilsObject::_getShopUrlMap ( )
protected

Returns shop url to id map from config.

Returns
array

Definition at line 515 of file oxutilsobject.php.

oxUtilsObject::_makeSafeModuleClassParents (   $aClassChain,
  $sBaseModule 
)
protected

Creates middle classes if needed.

Parameters
array$aClassChainModule names
string$sBaseModuleOxid base class
Exceptions
oxSystemComponentExceptionmissing system component exception
Returns
string

Definition at line 372 of file oxutilsobject.php.

oxUtilsObject::_setToCache (   $sVarName,
  $sValue,
  $blSubshopSpecific = true 
)
protected

Writes shop module variable information to cache.

Parameters
string$sVarNameVariable name
string$sValueVariable value.
bool$blSubshopSpecificIndicates should cache be shop specific or not

Definition at line 668 of file oxutilsobject.php.

oxUtilsObject::generateUId ( )

Returns generated unique ID.

Returns
string

Definition at line 253 of file oxutilsobject.php.

oxUtilsObject::getClassName (   $sClassName)

Returns name of class file, according to class name.

Parameters
string$sClassNameClass name
Returns
string

Definition at line 268 of file oxutilsobject.php.

static oxUtilsObject::getInstance ( )
static

Returns object instance

Returns
oxUtilsObject

Definition at line 64 of file oxutilsobject.php.

oxUtilsObject::getModuleVar (   $sModuleVarName)

Retrieves module configuration variable for the base shop. Currently getModuleVar() is expected to be called with one of the values: aModules | aDisabledModules | aModulePaths This method is independent from oxConfig functionality.

Parameters
string$sModuleVarNameConfiguration array name
Returns
array

Definition at line 458 of file oxutilsobject.php.

oxUtilsObject::getShopId ( )

Returns active shop id. This method works independently from other classes.

Returns
string

Definition at line 444 of file oxutilsobject.php.

oxUtilsObject::oxNew (   $sClassName)

Creates and returns new object. If creation is not available, dies and outputs error message.

Parameters
string$sClassNameName of class
Exceptions
oxSystemComponentExceptionin case that class does not exists
Returns
object

Definition at line 132 of file oxutilsobject.php.

static oxUtilsObject::resetClassInstances ( )
static

Resets previously set instances

Definition at line 97 of file oxutilsobject.php.

oxUtilsObject::resetInstanceCache (   $sClassName = null)

Resets instance cache

Parameters
string$sClassNameclass name in the cache
Returns
null;

Definition at line 230 of file oxutilsobject.php.

static oxUtilsObject::resetModuleVars ( )
static

Resets previously set module information.

Definition at line 107 of file oxutilsobject.php.

static oxUtilsObject::setClassInstance (   $sClassName,
  $oInstance 
)
static

Factory instance setter. Sets the instance to be returned over later called oxNew(). This method is mostly intended to be used by phpUnit tests.

Parameters
string$sClassNameClass name expected to be later supplied over oxNew
object$oInstanceInstance object

Definition at line 88 of file oxutilsobject.php.

oxUtilsObject::setModuleVar (   $sModuleVarName,
  $aValues 
)

Sets module information variable. The variable is set statically and is not saved for future.

Parameters
string$sModuleVarNameConfiguration array name
array$aValuesModule name values

Definition at line 486 of file oxutilsobject.php.

Member Data Documentation

oxUtilsObject::$_aClassInstances = array()
staticprotected

Definition at line 50 of file oxutilsobject.php.

oxUtilsObject::$_aClassNameCache = array()
protected

Definition at line 22 of file oxutilsobject.php.

oxUtilsObject::$_aInstanceCache = array()
staticprotected

Definition at line 36 of file oxutilsobject.php.

oxUtilsObject::$_aLoadedArticles = array()
staticprotected

Definition at line 29 of file oxutilsobject.php.

oxUtilsObject::$_aModuleVars = array()
staticprotected

Definition at line 43 of file oxutilsobject.php.

oxUtilsObject::$_instance = null
staticprivate

Definition at line 57 of file oxutilsobject.php.

const oxUtilsObject::CACHE_FILE_PREFIX = "config"

Cache file prefix

Definition at line 15 of file oxutilsobject.php.


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