Passed
Push — develop ( 319bd8...330c7a )
by Neill
16:41 queued 15s
created

CheckList::getComponentDetails()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
/**
3
 * @link http://www.newicon.net/neon
4
 * @copyright Copyright (c) 2016 Newicon Ltd
5
 * @license http://www.newicon.net/neon/license
6
 */
7
8
namespace neon\core\form\fields;
9
10
use neon\core\grid\query\IQuery;
11
use neon\core\helpers\Arr;
12
use \neon\core\helpers\Html;
13
14
/**
15
 * Class Text
16
 * @package neon\core\form
17
 */
18
class CheckList extends ChoiceMultiple
19
{
20
	/**
21
	 * @inheritDoc
22
	 */
23
	public function getValueDisplay($context='')
24
	{
25
		$items = $this->getSelectedItems();
26
		return Html::displayAsTags($items);
27
	}
28
29
	/**
30
	 * @inheritdoc
31
	 */
32
	public function getValue()
33
	{
34
		$value = parent::getValue();
35
		return $value ? $value : [];
36
	}
37
38
	/**
39
	 * @inheritdoc
40
	 */
41
	public function getComponentDetails()
42
	{
43
		return [
44
			'label' => 'Checklist', 'group' => 'Choice', 'icon' => 'fa fa-list', 'order' => 441,
45
		];
46
	}
47
}