Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZMultiOption2 Class Reference

Encapsulates multiple options in one datatype. More...

## Public Member Functions
| __construct ( $name, $id=0, $multioptionIDCounter=0, $optionCounter=0, $groupID=0)
| setGroupIDCounter ( $groupIDCounter)
| getGroupIDCounter ()
| setMultiOptionIDCounter ( $multioptionIDCounter)
| getMultiOptionIDCounter ()
| setOptionCounter ( $optionCounter)
| getOptionCounter ()
| addChildGroup ( $group, $multioptionID=false)
| addMultiOption ( $name, $multiOptionPriority, $defaultValue, $multiOptionID)
| addOption ( $newID, $OptionID, $optionValue, $optionAdditionalPrice, $isSelectable=1, $objectID=0)
| addOptionForMultioptionID ( $multioptionID, $OptionID, $optionValue, $optionAdditionalPrice)
| setObjectForOption ( $multioptionID, $optionID, $objectID)
| removeObjectFromOption ( $multioptionID, $optionID)
| findGroup ( $groupID, $depth=0, $groupStack=array())
| findMultiOption ( $multioptionID, $depth=0)
| findOption ( $multioption, $optionID)
| runFunctionForAllGroups ( $func, $params)
| resetCounters ()
| resetOptionCounter ()
| changeMultiOptionId ()
| removeChildGroup ( $groupID, $depth=0)
| removeMultiOptions ( $array_remove)
| removeOptions ( $arrayRemove, $optionId)
| getIDsFromMultioptions ( $params)
| cleanupRules ()
| addOptionToRules ( $multioptionID, $optionID)
| attributes ()
| hasAttribute ( $name)
| attribute ( $name)
| initCountersRecursive ()
| initCounters ( $group)
| decodeXML ( $xmlString)
| initFromXMLCompat ( $root, $new=false)
| initGroupFromDom ( $root, $new=false)
| xmlString ()
| createDomElementForGroup ( $doc, $groupNode, $depth=0)

## Public Attributes
| $ID
| $Rules
| $MultiOptionCount
| $Name
| $GroupID
| $Options
| Contains the Options. More...
| $MultiOptionIDCounter
| Contains the multioption counter value. More...
| $GroupIDCounter
| $OptionCounter
| Contains the option counter value. More...
| $ChildGroupList
| $MultioptionIDList = array()
| $OptionIDList = array()

## Detailed Description

Encapsulates multiple options in one datatype.

Definition at line 16 of file ezmultioption2.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZMultiOption2::__construct | ( |  | $name,
|  |  | $id = `0`,
|  |  | $multioptionIDCounter = `0`,
|  |  | $optionCounter = `0`,
|  |  | $groupID = `0`
| ) |  |

Initializes with empty multioption2 list.

Parameters

  | $name |
  int | $id |
  int | $multioptionIDCounter |
  int | $optionCounter |
  int | $groupID |

Definition at line 33 of file ezmultioption2.php.

## Member Function Documentation

## ◆ addChildGroup()

eZMultiOption2::addChildGroup | ( |  | $group,
|  |  | $multioptionID = `false`
| ) |  |

Definition at line 74 of file ezmultioption2.php.

References $GroupIDCounter, and initCounters().

Referenced by decodeXML().

## ◆ addMultiOption()

eZMultiOption2::addMultiOption | ( |  | $name,
|  |  | $multiOptionPriority,
|  |  | $defaultValue,
|  |  | $multiOptionID
| ) |  |

Adds an Multioption named $name

Parameters

  $name | contains the name of multioption.
  $multiOptionPriority | is stored for displaying the array in order.
  $defaultValue | is stored to display the options by default.

Returns
  The ID of the multioption that was added.

Definition at line 104 of file ezmultioption2.php.

References $MultiOptionIDCounter.

Referenced by initGroupFromDom().

## ◆ addOption()

eZMultiOption2::addOption | ( |  | $newID,
|  |  | $OptionID,
|  |  | $optionValue,
|  |  | $optionAdditionalPrice,
|  |  | $isSelectable = `1`,
|  |  | $objectID = `0`
| ) |  |

Adds an Option to multioption $name

Parameters

  $newID | is the element key value to which the new option will be added.
  $optionValue | is the original value to display for users.
  $optionAdditionalPrice | is a price value that is used to store price of the option values.

Definition at line 135 of file ezmultioption2.php.

References $OptionCounter.

Referenced by initGroupFromDom().

## ◆ addOptionForMultioptionID()

eZMultiOption2::addOptionForMultioptionID | ( |  | $multioptionID,
|  |  | $OptionID,
|  |  | $optionValue,
|  |  | $optionAdditionalPrice
| ) |  |

Definition at line 161 of file ezmultioption2.php.

References findMultiOption(), and initCounters().

## ◆ addOptionToRules()

eZMultiOption2::addOptionToRules | ( |  | $multioptionID,
|  |  | $optionID
| ) |  |

Definition at line 500 of file ezmultioption2.php.

References $Rules.

## ◆ attribute()

eZMultiOption2::attribute | ( |  | $name | ) |

Returns an attribute. The valid attributes are `name` and `multioption_list` name contains the name of multioption multioption_list contains the list of all multioptions.

Definition at line 543 of file ezmultioption2.php.

References $ChildGroupList, $GroupID, $ID, $Name, $Options, $Rules, and eZDebug\writeError().

Referenced by findGroup(), initCounters(), and removeChildGroup().

## ◆ attributes()

eZMultiOption2::attributes | ( |  | ) |

Returns
  list of supported attributes

Definition at line 518 of file ezmultioption2.php.

Referenced by hasAttribute().

## ◆ changeMultiOptionId()

eZMultiOption2::changeMultiOptionId | ( |  | ) |

Change the id of multioption in ascending order.

Definition at line 354 of file ezmultioption2.php.

Referenced by initGroupFromDom(), and removeMultiOptions().

## ◆ cleanupRules()

eZMultiOption2::cleanupRules | ( |  | ) |

Definition at line 454 of file ezmultioption2.php.

References runFunctionForAllGroups().

## ◆ createDomElementForGroup()

eZMultiOption2::createDomElementForGroup | ( |  | $doc,
|  |  | $groupNode,
|  |  | $depth = `0`
| ) |  |

Definition at line 798 of file ezmultioption2.php.

Referenced by xmlString().

## ◆ decodeXML()

eZMultiOption2::decodeXML | ( |  | $xmlString | ) |

Will decode an xml string and initialize the eZ Multi option object. If $xmlString is on empty then it will call addMultiOption() and addOption() functions to create new multioption else it will decode the xml string.

Parameters

  $xmlString | contain the complete data structure for multioptions.

See also
  xmlString()

Definition at line 607 of file ezmultioption2.php.

References addChildGroup(), initCounters(), initFromXMLCompat(), and initGroupFromDom().

## ◆ findGroup()

eZMultiOption2::findGroup | ( |  | $groupID,
|  |  | $depth = `0`,
|  |  | $groupStack = `array()`
| ) |  |

Definition at line 203 of file ezmultioption2.php.

References attribute().

## ◆ findMultiOption()

eZMultiOption2::findMultiOption | ( |  | $multioptionID,
|  |  | $depth = `0`
| ) |  |

Definition at line 239 of file ezmultioption2.php.

Referenced by addOptionForMultioptionID(), removeObjectFromOption(), and setObjectForOption().

## ◆ findOption()

eZMultiOption2::findOption | ( |  | $multioption,
|  |  | $optionID
| ) |  |

Definition at line 271 of file ezmultioption2.php.

## ◆ getGroupIDCounter()

eZMultiOption2::getGroupIDCounter | ( |  | ) |

Definition at line 51 of file ezmultioption2.php.

References $GroupIDCounter.

Referenced by initCounters().

## ◆ getIDsFromMultioptions()

eZMultiOption2::getIDsFromMultioptions | ( |  | $params | ) |

Definition at line 439 of file ezmultioption2.php.

## ◆ getMultiOptionIDCounter()

eZMultiOption2::getMultiOptionIDCounter | ( |  | ) |

Definition at line 60 of file ezmultioption2.php.

References $MultiOptionIDCounter.

Referenced by initCounters().

## ◆ getOptionCounter()

eZMultiOption2::getOptionCounter | ( |  | ) |

Definition at line 69 of file ezmultioption2.php.

References $OptionCounter.

Referenced by initCounters().

## ◆ hasAttribute()

eZMultiOption2::hasAttribute | ( |  | $name | ) |

Returns true if object have an attribute. The valid attributes are `name` and `multioption_list`.

Parameters

  $name | contains the name of attribute

Definition at line 533 of file ezmultioption2.php.

References attributes().

## ◆ initCounters()

eZMultiOption2::initCounters | ( |  | $group | ) |

Definition at line 585 of file ezmultioption2.php.

References attribute(), getGroupIDCounter(), getMultiOptionIDCounter(), getOptionCounter(), and setMultiOptionIDCounter().

Referenced by addChildGroup(), addOptionForMultioptionID(), decodeXML(), initFromXMLCompat(), and initGroupFromDom().

## ◆ initCountersRecursive()

eZMultiOption2::initCountersRecursive | ( |  | ) |

Definition at line 580 of file ezmultioption2.php.

References runFunctionForAllGroups().

## ◆ initFromXMLCompat()

eZMultiOption2::initFromXMLCompat | ( |  | $root,
|  |  | $new = `false`
| ) |  |

Definition at line 664 of file ezmultioption2.php.

References initCounters().

Referenced by decodeXML().

## ◆ initGroupFromDom()

eZMultiOption2::initGroupFromDom | ( |  | $root,
|  |  | $new = `false`
| ) |  |

Definition at line 684 of file ezmultioption2.php.

References $GroupID, $GroupIDCounter, $ID, $MultiOptionIDCounter, addMultiOption(), addOption(), changeMultiOptionId(), and initCounters().

Referenced by decodeXML().

## ◆ removeChildGroup()

eZMultiOption2::removeChildGroup | ( |  | $groupID,
|  |  | $depth = `0`
| ) |  |

Definition at line 364 of file ezmultioption2.php.

References attribute().

## ◆ removeMultiOptions()

eZMultiOption2::removeMultiOptions | ( |  | $array_remove | ) |

Remove MultiOption from the array. After calling this function all the options associated with that multioption will be removed. This function also calles to changeMultiOption to reset the key value of multioption array.

Parameters

  $array_remove | is the array of those multiOptions which is selected to remove.

See also
  removeOptions()

Definition at line 406 of file ezmultioption2.php.

References changeMultiOptionId().

## ◆ removeObjectFromOption()

eZMultiOption2::removeObjectFromOption | ( |  | $multioptionID,
|  |  | $optionID
| ) |  |

Definition at line 184 of file ezmultioption2.php.

References findMultiOption().

## ◆ removeOptions()

eZMultiOption2::removeOptions | ( |  | $arrayRemove,
|  |  | $optionId
| ) |  |

Remove Options from the multioption. This function first remove selected options and then reset the key value if all options for that multioption.

Parameters

  $arrayRemove | is a list of all array elements which is selected to remove from the multioptions.
  $optionId | is the key value if multioption from which it is required to remove the options.

See also
  removeMultiOptions()

Definition at line 424 of file ezmultioption2.php.

## ◆ resetCounters()

eZMultiOption2::resetCounters | ( |  | ) |

Definition at line 327 of file ezmultioption2.php.

References resetOptionCounter().

## ◆ resetOptionCounter()

eZMultiOption2::resetOptionCounter | ( |  | ) |

Finds the largest `option_id` among the options and sets it as $this->OptionCounter

Definition at line 335 of file ezmultioption2.php.

Referenced by resetCounters().

## ◆ runFunctionForAllGroups()

eZMultiOption2::runFunctionForAllGroups | ( |  | $func,
|  |  | $params
| ) |  |

Definition at line 309 of file ezmultioption2.php.

Referenced by cleanupRules(), and initCountersRecursive().

## ◆ setGroupIDCounter()

eZMultiOption2::setGroupIDCounter | ( |  | $groupIDCounter | ) |

Definition at line 46 of file ezmultioption2.php.

## ◆ setMultiOptionIDCounter()

eZMultiOption2::setMultiOptionIDCounter | ( |  | $multioptionIDCounter | ) |

Definition at line 55 of file ezmultioption2.php.

Referenced by initCounters().

## ◆ setObjectForOption()

eZMultiOption2::setObjectForOption | ( |  | $multioptionID,
|  |  | $optionID,
|  |  | $objectID
| ) |  |

Definition at line 171 of file ezmultioption2.php.

References findMultiOption().

## ◆ setOptionCounter()

eZMultiOption2::setOptionCounter | ( |  | $optionCounter | ) |

Definition at line 64 of file ezmultioption2.php.

## ◆ xmlString()

eZMultiOption2::xmlString | ( |  | ) |

Will return the XML string for this MultiOption set.

See also
  decodeXML()

Definition at line 761 of file ezmultioption2.php.

References createDomElementForGroup().

## Member Data Documentation

## ◆ $ChildGroupList

eZMultiOption2::$ChildGroupList

Definition at line 880 of file ezmultioption2.php.

Referenced by attribute().

## ◆ $GroupID

eZMultiOption2::$GroupID

Definition at line 872 of file ezmultioption2.php.

Referenced by attribute(), and initGroupFromDom().

## ◆ $GroupIDCounter

eZMultiOption2::$GroupIDCounter

Definition at line 877 of file ezmultioption2.php.

Referenced by addChildGroup(), getGroupIDCounter(), and initGroupFromDom().

## ◆ $ID

eZMultiOption2::$ID

Definition at line 18 of file ezmultioption2.php.

Referenced by attribute(), and initGroupFromDom().

## ◆ $MultiOptionCount

eZMultiOption2::$MultiOptionCount

Definition at line 23 of file ezmultioption2.php.

## ◆ $MultiOptionIDCounter

eZMultiOption2::$MultiOptionIDCounter

Contains the multioption counter value.

Definition at line 876 of file ezmultioption2.php.

Referenced by addMultiOption(), getMultiOptionIDCounter(), and initGroupFromDom().

## ◆ $MultioptionIDList

eZMultiOption2::$MultioptionIDList = array()

Definition at line 881 of file ezmultioption2.php.

## ◆ $Name

eZMultiOption2::$Name

Contains the Option name

Definition at line 871 of file ezmultioption2.php.

Referenced by attribute().

## ◆ $OptionCounter

eZMultiOption2::$OptionCounter

Contains the option counter value.

Definition at line 879 of file ezmultioption2.php.

Referenced by addOption(), and getOptionCounter().

## ◆ $OptionIDList

eZMultiOption2::$OptionIDList = array()

Definition at line 882 of file ezmultioption2.php.

## ◆ $Options

eZMultiOption2::$Options

Contains the Options.

Definition at line 874 of file ezmultioption2.php.

Referenced by attribute().

## ◆ $Rules

eZMultiOption2::$Rules

Definition at line 19 of file ezmultioption2.php.

Referenced by addOptionToRules(), and attribute().

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

- ezmultioption2.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.