Completed
Push — 0.3-dev ( 291149...449c2f )
by Arnaud
14:26
created

Boolean::render()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace LAG\AdminBundle\Field\Field;
4
5
class Boolean extends StringField
6
{
7
    public function render($value)
8
    {
9
        $result = filter_var($value, FILTER_VALIDATE_BOOLEAN);
10
        $text = ($result) ? 'lag.admin.true' : 'lag.admin.false';
11
12
        return parent::render($text);
13
    }
14
15
    public function getType()
16
    {
17
        return 'boolean';
18
    }
19
}
20