CleaveNumericField::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 6
rs 10
1
<?php
2
3
namespace LeKoala\FormElements;
4
5
use SilverStripe\ORM\DataObjectInterface;
6
7
/**
8
 * Format numeric field
9
 */
10
class CleaveNumericField extends CleaveField
11
{
12
    /**
13
     * Set this to true if internal value is seconds
14
     *
15
     * @var boolean
16
     */
17
    protected $isNumeric = false;
18
19
    public function __construct($name, $title = null, $value = null)
20
    {
21
        parent::__construct($name, $title, $value);
22
23
        $this->setCleaveType('numeral');
24
        $this->setConfig("numericOnly", true);
25
    }
26
}
27