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

Public Member Functions

 init ($oArticles)
 buildMdVariants ($oVariants, $sParentId)
 genVariantFromSell ($aSels, $oArticle)
 isMdVariant ($oArticle)
 buildVariantSelections ($sVarName, $oVariantList, $aFilter, $sActVariantId, $iLimit=0)
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 __construct ()
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

Protected Member Functions

 _assignValues ($aValues, $oVariants, $oArticle, $aConfLanguages)
 _getValuePrice ($oValue, $dParentPrice)
 _createNewVariant ($aParams=null, $sParentId=null)
 _updateArticleVarName ($sUpdate, $sArtId)
 _fillVariantSelections ($oVariantList, $iVarSelCnt, &$aFilter, $sActVariantId)
 _cleanFilter ($aFilter)
 _applyVariantSelectionsFilter ($aSelections, $aFilter)
 _buildVariantSelectionsList ($aVarSelects, $aSelections)
 _getSelections ($sTitle)

Protected Attributes

 $_oArticles = null
 $_sMdSeparator = " | "
 $_oMdVariants = null

Additional Inherited Members

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

Detailed Description

oxVariantHandler encapsulates methods dealing with multidimensional variant and variant names.

Definition at line 7 of file oxvarianthandler.php.

Member Function Documentation

oxVariantHandler::_applyVariantSelectionsFilter (   $aSelections,
  $aFilter 
)
protected

Applies filter on variant selection array

Parameters
array$aSelectionsselections
array$aFilterfilter
Returns
array

Definition at line 354 of file oxvarianthandler.php.

oxVariantHandler::_assignValues (   $aValues,
  $oVariants,
  $oArticle,
  $aConfLanguages 
)
protected

Assigns values of selection list to variants

Parameters
array$aValuesmultilang values of selection list
object$oVariantsvariant list
object$oArticleparent article
array$aConfLanguagesarray of all active languages
Returns
mixed

Definition at line 123 of file oxvarianthandler.php.

oxVariantHandler::_buildVariantSelectionsList (   $aVarSelects,
  $aSelections 
)
protected

Builds variant selections list - array containing oxVariantSelectList

Parameters
array$aVarSelectsvariant selection titles
array$aSelectionsvariant selections
Returns
array

Definition at line 405 of file oxvarianthandler.php.

oxVariantHandler::_cleanFilter (   $aFilter)
protected

Cleans up user given filter. If filter was empty - returns false

Parameters
array$aFilteruser given filter
Returns
array | bool

Definition at line 332 of file oxvarianthandler.php.

oxVariantHandler::_createNewVariant (   $aParams = null,
  $sParentId = null 
)
protected

Creates new article variant.

Parameters
array$aParamsassigned parameters
string$sParentIdparent article id
Returns
null

Definition at line 237 of file oxvarianthandler.php.

oxVariantHandler::_fillVariantSelections (   $oVariantList,
  $iVarSelCnt,
$aFilter,
  $sActVariantId 
)
protected

Creates array/matrix with variant selections

Parameters
oxArticleList$oVariantListvariant list
int$iVarSelCntpossible variant selection count
array&$aFilteractive filter array
string$sActVariantIdactive variant id
Returns
array

Definition at line 298 of file oxvarianthandler.php.

oxVariantHandler::_getSelections (   $sTitle)
protected

In case multidimentional variants ON explodes title by _sMdSeparator and returns array, else - returns array containing title

Parameters
string$sTitletitle to process
Returns
array

Definition at line 430 of file oxvarianthandler.php.

oxVariantHandler::_getValuePrice (   $oValue,
  $dParentPrice 
)
protected

Returns article price

Parameters
object$oValueselection list value
double$dParentPriceparent article price
Returns
double

Definition at line 209 of file oxvarianthandler.php.

oxVariantHandler::_updateArticleVarName (   $sUpdate,
  $sArtId 
)
protected

Inserts article variant name for all languages

Parameters
string$sUpdatequery for update variant name
string$sArtIdparent article id

Definition at line 263 of file oxvarianthandler.php.

oxVariantHandler::buildMdVariants (   $oVariants,
  $sParentId 
)

Returns multidimensional variant structure

Parameters
object$oVariantsall article variants
string$sParentIdparent article id
Returns
OxMdVariants

Definition at line 49 of file oxvarianthandler.php.

oxVariantHandler::buildVariantSelections (   $sVarName,
  $oVariantList,
  $aFilter,
  $sActVariantId,
  $iLimit = 0 
)

Builds variant selection list

Parameters
string$sVarNameproduct (parent product) oxvarname value
oxarticlelist$oVariantListvariant list
array$aFiltervariant filter
string$sActVariantIdactive variant id
int$iLimitlimit variant lists count (if non zero, return limited number of multidimensional variant selections)
Returns
Ambigous false | array

Definition at line 453 of file oxvarianthandler.php.

oxVariantHandler::genVariantFromSell (   $aSels,
  $oArticle 
)

Generate variants from selection lists

Parameters
array$aSelsids of selection list
object$oArticleparent article

Definition at line 76 of file oxvarianthandler.php.

oxVariantHandler::init (   $oArticles)

Sets internal variant name array from article list.

Parameters
array$oArticlesVariant list

Definition at line 36 of file oxvarianthandler.php.

oxVariantHandler::isMdVariant (   $oArticle)

Check if variant is multidimensional

Parameters
oxArticle$oArticleArticle object
Returns
bool

Definition at line 277 of file oxvarianthandler.php.

Member Data Documentation

oxVariantHandler::$_oArticles = null
protected

Definition at line 15 of file oxvarianthandler.php.

oxVariantHandler::$_oMdVariants = null
protected

Definition at line 29 of file oxvarianthandler.php.

oxVariantHandler::$_sMdSeparator = " | "
protected

Definition at line 22 of file oxvarianthandler.php.


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