Passed
Push — master ( dd6e86...c22a0f )
by Julito
10:51 queued 23s
created

IconColumn::renderCell()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 3
dl 0
loc 7
rs 10
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CoreBundle\Grid\Column;
5
6
use APY\DataGridBundle\Grid\Column\Column;
7
8
/**
9
 * Class IconColumn.
10
 */
11
class IconColumn extends Column
12
{
13
    public function __initialize(array $params)
14
    {
15
        $params['filterable'] = false;
16
        $params['sortable'] = false;
17
18
        parent::__initialize($params);
19
    }
20
21
    public function getType()
22
    {
23
        return 'icon';
24
    }
25
26
    public function renderCell($value, $row, $router)
27
    {
28
        if ($value) {
29
            return "<img src=\"{{ '/".$value."' | apply_filter('small') }}\">";
30
        }
31
32
        return false;
33
    }
34
}
35