2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Superclass for the Property Group classes.
8 if (! defined('PHPMYADMIN')) {
12 /* This class extends the OptionsPropertyItem class */
13 require_once 'OptionsPropertyItem.class.php';
16 * Parents group property items and provides methods to manage groups of
19 * @todo modify descriptions if needed, when the options are integrated
22 abstract class OptionsPropertyGroup
extends OptionsPropertyItem
25 * Holds a group of properties (OptionsPropertyItem instances)
32 * Adds a property to the group of properties
34 * @param OptionsPropertyItem $property the property instance to be added
39 public function addProperty($property)
41 if (! $this->getProperties() == null
42 && in_array($property, $this->getProperties(), true)
46 $this->_properties
[] = $property;
50 * Removes a property from the group of properties
52 * @param OptionsPropertyItem $property the property instance to be removed
57 public function removeProperty($property)
59 $this->_properties
= array_udiff(
60 $this->getProperties(),
62 // for PHP 5.2 compability
65 'return ($a === $b ) ? 0 : 1'
71 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
75 * Gets the instance of the class
79 public function getGroup()
85 * Gets the group of properties
89 public function getProperties()
91 return $this->_properties
;
95 * Gets the number of properties
99 public function getNrOfProperties()
101 return count($this->_properties
);