Public Member Functions | Protected Member Functions | Protected Attributes

oxVariantHandler Class Reference

Inheritance diagram for oxVariantHandler:
Collaboration diagram for oxVariantHandler:

List of all members.

Public Member Functions

 init ($oArticles)
 buildMdVariants ($oVariants, $sParentId)
 genVariantFromSell ($aSels, $oArticle)
 isMdVariant ($oArticle)
 buildVariantSelections ($sVarName, $oVariantList, $aFilter, $sActVariantId, $iLimit=0)

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

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 $aSelections selections
array $aFilter filter
Returns:
array

Definition at line 357 of file oxvarianthandler.php.

oxVariantHandler._assignValues ( aValues,
oVariants,
oArticle,
aConfLanguages 
) [protected]

Assigns values of selection list to variants

Parameters:
array $aValues multilang values of selection list
object $oVariants variant list
object $oArticle parent article
array $aConfLanguages array of all active languages
Returns:
mixed

Definition at line 124 of file oxvarianthandler.php.

oxVariantHandler._buildVariantSelectionsList ( aVarSelects,
aSelections 
) [protected]

Builds variant selections list - array containing oxVariantSelectList

Parameters:
array $aVarSelects variant selection titles
array $aSelections variant selections
Returns:
array

Definition at line 407 of file oxvarianthandler.php.

oxVariantHandler._cleanFilter ( aFilter  )  [protected]

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

Parameters:
array $aFilter user given filter
Returns:
array | bool

Definition at line 335 of file oxvarianthandler.php.

oxVariantHandler._createNewVariant ( aParams = null,
sParentId = null 
) [protected]

Creates new article variant.

Parameters:
array $aParams assigned parameters
string $sParentId parent article id
Returns:
null

Definition at line 236 of file oxvarianthandler.php.

oxVariantHandler._fillVariantSelections ( oVariantList,
iVarSelCnt,
&$  aFilter,
sActVariantId 
) [protected]

Creates array/matrix with variant selections

Parameters:
oxArticleList $oVariantList variant list
int $iVarSelCnt possible variant selection count
array &$aFilter active filter array
string $sActVariantId active variant id
Returns:
array

Definition at line 302 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 $sTitle title to process
Returns:
array

Definition at line 432 of file oxvarianthandler.php.

oxVariantHandler._getValuePrice ( oValue,
dParentPrice 
) [protected]

Returns article price

Parameters:
object $oValue selection list value
double $dParentPrice parent 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 $sUpdate query for update variant name
string $sArtId parent article id
Returns:
null

Definition at line 267 of file oxvarianthandler.php.

oxVariantHandler.buildMdVariants ( oVariants,
sParentId 
)

Returns multidimensional variant structure

Parameters:
object $oVariants all article variants
string $sParentId parent article id
Returns:
OxMdVariants

Definition at line 50 of file oxvarianthandler.php.

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

Builds variant selection list

Parameters:
string $sVarName product (parent product) oxvarname value
oxarticlelist $oVariantList variant list
array $aFilter variant filter
string $sActVariantId active variant id
int $iLimit limit variant lists count (if non zero, return limited number of multidimensional variant selections)
Returns:
Ambigous false | array

Definition at line 455 of file oxvarianthandler.php.

oxVariantHandler.genVariantFromSell ( aSels,
oArticle 
)

Generate variants from selection lists

Parameters:
array $aSels ids of selection list
object $oArticle parent article
Returns:
null

Definition at line 77 of file oxvarianthandler.php.

oxVariantHandler.init ( oArticles  ) 

Sets internal variant name array from article list.

Parameters:
oxList[string]oxArticle $oArticles Variant list as
Returns:
null

Definition at line 37 of file oxvarianthandler.php.

oxVariantHandler.isMdVariant ( oArticle  ) 

Check if variant is multidimensional

Parameters:
oxArticle $oArticle Article object
Returns:
bool

Definition at line 281 of file oxvarianthandler.php.


Member Data Documentation

oxVariantHandler.$_oArticles = null [protected]

Definition at line 14 of file oxvarianthandler.php.

oxVariantHandler.$_oMdVariants = null [protected]

Definition at line 28 of file oxvarianthandler.php.

oxVariantHandler.$_sMdSeparator = " | " [protected]

Definition at line 21 of file oxvarianthandler.php.


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