Completed
Push — master ( 8482f5...6f4e0b )
by max
02:05
created

Version::getVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace T4web\Migrations\Version;
4
5
class Version
6
{
7
8
    const TABLE_NAME = 'migration_version';
9
10
    /**
11
     * @var int
12
     */
13
    protected $id;
14
15
    /**
16
     * @var int
17
     */
18
    protected $version;
19
20
    public function exchangeArray($data)
21
    {
22
        foreach (array_keys(get_object_vars($this)) as $property) {
23
            $this->{$property} = (isset($data[$property])) ? $data[$property] : null;
24
        }
25
    }
26
27
    /**
28
     * @return int
29
     */
30
    public function getId()
31
    {
32
        return $this->id;
33
    }
34
35
    /**
36
     * @return int
37
     */
38
    public function getVersion()
39
    {
40
        return $this->version;
41
    }
42
}
43