2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Superclass for the Property Group classes.
8 namespace PMA\libraries\properties\options
;
11 * Parents group property items and provides methods to manage groups of
14 * @todo modify descriptions if needed, when the options are integrated
17 abstract class OptionsPropertyGroup
extends OptionsPropertyItem
implements \Countable
20 * Holds a group of properties (PMA\libraries\properties\options\OptionsPropertyItem instances)
27 * Adds a property to the group of properties
29 * @param OptionsPropertyItem $property the property instance to be added
34 public function addProperty($property)
36 if (!$this->getProperties() == null
37 && in_array($property, $this->getProperties(), true)
41 $this->_properties
[] = $property;
45 * Removes a property from the group of properties
47 * @param OptionsPropertyItem $property the property instance to be removed
52 public function removeProperty($property)
54 $this->_properties
= array_diff(
55 $this->getProperties(),
61 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
64 * Gets the instance of the class
68 public function getGroup()
74 * Gets the group of properties
78 public function getProperties()
80 return $this->_properties
;
84 * Gets the number of properties
88 public function getNrOfProperties()
90 if (is_null($this->_properties
)) {
93 return count($this->_properties
);
97 * Countable interface implementation.
101 public function count() {
102 return $this->getNrOfProperties();