@@ 5-20 (lines=16) @@ | ||
2 | ||
3 | namespace FForattini\Btrieve\Column; |
|
4 | ||
5 | class FloatColumn extends ColumnRule implements ColumnInterface |
|
6 | { |
|
7 | const DEFAULT_LENGTH = 2; |
|
8 | ||
9 | public function __construct($title, $length = self::DEFAULT_LENGTH) |
|
10 | { |
|
11 | $this->setTitle($title); |
|
12 | $this->setType(self::TYPE_FLOAT); |
|
13 | $this->setLength($length); |
|
14 | } |
|
15 | ||
16 | public static function cast($content) |
|
17 | { |
|
18 | return floatval($content); |
|
19 | } |
|
20 | } |
|
21 |
@@ 5-20 (lines=16) @@ | ||
2 | ||
3 | namespace FForattini\Btrieve\Column; |
|
4 | ||
5 | class IntColumn extends ColumnRule implements ColumnInterface |
|
6 | { |
|
7 | const DEFAULT_LENGTH = 2; |
|
8 | ||
9 | public function __construct($title, $length = self::DEFAULT_LENGTH) |
|
10 | { |
|
11 | $this->setTitle($title); |
|
12 | $this->setType(self::TYPE_INT); |
|
13 | $this->setLength($length); |
|
14 | } |
|
15 | ||
16 | public static function cast($content) |
|
17 | { |
|
18 | return intval($content); |
|
19 | } |
|
20 | } |
|
21 |