TabbedSelectionGroup::FieldList()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 9
nc 2
nop 0
1
<?php
2
3
class TabbedSelectionGroup extends SelectionGroup {
4
5
	/**
6
	 * @return ArrayList
7
	 */
8
	public function FieldList() {
9
		$items = CompositeField::FieldList()->toArray();
10
		$fields = new ArrayList();
11
12
		foreach($items as $item) {
13
			$extra = array(
14
				'Selected' => $this->value == $item->getValue(),
15
			);
16
17
			$item = $item->customise($extra);
18
			$fields->push($item);
19
		}
20
21
		return $fields;
22
	}
23
}
24