blob: 1a03718cd3954b3b8c07fce9b004decc2d10cb6d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
<?php
/**
* Model for a select group element of the select widget.
*
* @author Stefan Osterloh <s.osterloh@uni-oldenburg.de>
* @license GPL2 or any later version
* @since Stud.IP 3.5
*/
class SelectGroupElement extends SelectElement
{
protected $elements;
/**
* Constructs the element with an id (value of the according option
* element) and a label (text content of the according option
* element).
*
* @param String $label Label content of the element
* @param Array $elements SelectElement-Objects for Optgroup
*/
public function __construct($label, $elements = [])
{
$this->label = $label;
$this->elements = $elements;
}
/**
* Sets the SelectElement-Objects for this Element
*
* @param Array $elements
*/
public function setElements($elements)
{
$this->elements = $elements;
}
/**
*
* @return Array with SelectElements
*/
public function getElements()
{
return $this->elements;
}
/**
* adds a single element of type SelectElement
*
* @param SelectElement $element
*/
public function addElement(SelectElement $element)
{
$this->elements[] = $element;
}
}
|