OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
oxMdVariant Class Reference
+ Inheritance diagram for oxMdVariant:
+ Collaboration diagram for oxMdVariant:

Public Member Functions

 setId ($sId)
 getId ()
 setParentId ($sParentId)
 getParentId ()
 setMdSubvariants ($aSubvariants)
 getMdSubvariants ()
 getFirstMdSubvariant ()
 getMdSubvariantByName ($sName)
 getLink ()
 setName ($sName)
 getName ()
 getDPrice ()
 getMinDPrice ()
 getMaxDepth ()
 getFPrice ()
 addNames ($sArtId, $aNames, $dPrice, $sUrl)
 getArticleId ()
 hasArticleId ($sArtId)
- 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

 _addMdSubvariant ($oSubvariant)
 _isFixedPrice ()

Protected Attributes

 $_sId
 $_sParentId
 $_sArticleId
 $_sName
 $_sUrl
 $_dPrice = null
 $_sFPrice
 $_aSubvariants = array()

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

Defines an element of multidimentional variant name tree structure. Contains article id, variant name, URL, price, price text, and a subset of MD variants.

Definition at line 7 of file oxmdvariant.php.

Member Function Documentation

oxMdVariant::_addMdSubvariant (   $oSubvariant)
protected

Adds one subvariant to subvariant set

Parameters
OxMdVariant$oSubvariantSubvariant
Returns
null

Definition at line 360 of file oxmdvariant.php.

oxMdVariant::_isFixedPrice ( )
protected

Checks if variant price is fixed or not ("from" price)

Returns
bool

Definition at line 370 of file oxmdvariant.php.

oxMdVariant::addNames (   $sArtId,
  $aNames,
  $dPrice,
  $sUrl 
)

Inits MD variant by name. In case $aNames parameter has more than one element addNames recursively adds names for subvariants.

Parameters
string$sArtIdArticle ID
array[int]$aNames Expected array of $sKey=>$sName pairs.
double$dPricePrice as double
string$sUrlArticle URL
Returns
null

Definition at line 299 of file oxmdvariant.php.

oxMdVariant::getArticleId ( )

Returns corresponding article id or recusively first variant id from subvariant set

Returns
string

Definition at line 322 of file oxmdvariant.php.

oxMdVariant::getDPrice ( )

Returns price

Returns
double

Definition at line 210 of file oxmdvariant.php.

oxMdVariant::getFirstMdSubvariant ( )

Returns first MD subvariant from subvariant set or null in case variant has no subvariants.

Returns
OxMdVariant

Definition at line 136 of file oxmdvariant.php.

oxMdVariant::getFPrice ( )

Returns MD variant price as a text.

Returns
string

Definition at line 264 of file oxmdvariant.php.

oxMdVariant::getId ( )

Returns MD variant identifier

Returns
string

Definition at line 82 of file oxmdvariant.php.

oxMdVariant::getLink ( )

Returns corresponding article URL or recusively first variant URL from subvariant set

Returns
string

Definition at line 174 of file oxmdvariant.php.

oxMdVariant::getMaxDepth ( )

Gets max subvariant depth. 0 means no deeper subvariants.

Returns
int

Definition at line 242 of file oxmdvariant.php.

oxMdVariant::getMdSubvariantByName (   $sName)

Checks for existing MD subvariant by name. Returns existing one or in case $sName has not been found creates an empty OxMdVariant instance.

Parameters
string$sNameSubvariant name
Returns
OxMdVariant

Definition at line 152 of file oxmdvariant.php.

oxMdVariant::getMdSubvariants ( )

Returns full array of subvariants

Returns
array[string]OxMdSubvariants

Definition at line 126 of file oxmdvariant.php.

oxMdVariant::getMinDPrice ( )

Returns min price recursively selected from full subvariant tree.

Returns
double

Definition at line 220 of file oxmdvariant.php.

oxMdVariant::getName ( )

Returns MD variant name

Returns
string

Definition at line 200 of file oxmdvariant.php.

oxMdVariant::getParentId ( )

Returns parent id

Returns
string

Definition at line 104 of file oxmdvariant.php.

oxMdVariant::hasArticleId (   $sArtId)

Checks whether $sArtId is one of subtree article ids.

Parameters
string$sArtIdArticle ID
Returns
bool

Definition at line 339 of file oxmdvariant.php.

oxMdVariant::setId (   $sId)

Sets MD variant identifier

Parameters
string$sIdNew id
Returns
null;

Definition at line 72 of file oxmdvariant.php.

oxMdVariant::setMdSubvariants (   $aSubvariants)

Sets MD subvariants

Parameters
array[string]OxMdVariant$aSubvariants Subvariants
Returns
null

Definition at line 116 of file oxmdvariant.php.

oxMdVariant::setName (   $sName)

Name setter

Parameters
string$sNameNew name
Returns
null;

Definition at line 190 of file oxmdvariant.php.

oxMdVariant::setParentId (   $sParentId)

Sets parent id

Parameters
string$sParentIdParent id
Returns
null;

Definition at line 94 of file oxmdvariant.php.

Member Data Documentation

oxMdVariant::$_aSubvariants = array()
protected

Definition at line 63 of file oxmdvariant.php.

oxMdVariant::$_dPrice = null
protected

Definition at line 49 of file oxmdvariant.php.

oxMdVariant::$_sArticleId
protected

Definition at line 28 of file oxmdvariant.php.

oxMdVariant::$_sFPrice
protected

Definition at line 56 of file oxmdvariant.php.

oxMdVariant::$_sId
protected

Definition at line 14 of file oxmdvariant.php.

oxMdVariant::$_sName
protected

Definition at line 35 of file oxmdvariant.php.

oxMdVariant::$_sParentId
protected

Definition at line 21 of file oxmdvariant.php.

oxMdVariant::$_sUrl
protected

Definition at line 42 of file oxmdvariant.php.


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