_itemName = $itemName; $this->_name = $name; if (!is_array($values)) { $this->_values = array($values); } else { $this->_values = $values; } } /** * Return the item name to which the attribute belongs * * @return string */ public function getItemName () { return $this->_itemName; } /** * Retrieve attribute values * * @return array */ public function getValues() { return $this->_values; } /** * Retrieve the attribute name * * @return string */ public function getName () { return $this->_name; } /** * Add value * * @param mixed $value * @return void */ public function addValue($value) { if (is_array($value)) { $this->_values += $value; } else { $this->_values[] = $value; } } public function setValues($values) { if (!is_array($values)) { $values = array($values); } $this->_values = $values; } }