Completed
Push — master ( a40390...c25130 )
by
11s
created

User::setState()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace LineMob\Core\Mocky\Doctrine\Model;
4
5
use LineMob\Core\Storage\CommandData;
6
use LineMob\Core\Storage\CommandDataInterface;
7
8
/**
9
 * @Entity
10
 * @Table(name="user")
11
 */
12
class User extends CommandData implements CommandDataInterface
13
{
14
    const START_STATE = 'started';
15
16
    /**
17
     * @Id
18
     * @GeneratedValue
19
     * @Column(type="integer")
20
     */
21
    protected $id;
22
23
    /**
24
     * @Column(type="string", nullable=true)
25
     */
26
    protected $lineUserId;
27
28
    /**
29
     * @Column(type="string", nullable=true)
30
     */
31
    protected $lineActiveCmd;
32
33
    /**
34
     * @Column(type="array", nullable=true)
35
     */
36
    protected $lineCommandData;
37
38
    /**
39
     * @Column(type="datetime_immutable", nullable=true)
40
     */
41
    protected $lineLastLogin;
42
43
    /**
44
     * @Column(type="json_array", nullable=true)
45
     * @var array
46
     */
47
    protected $state = [self::START_STATE => 1];
48
49
    /**
50
     * @return int
51
     */
52
    public function getId()
53
    {
54
        return $this->id;
55
    }
56
57
    /**
58
     * @return \DateTimeImmutable
59
     */
60
    public function getLineLastLogin()
61
    {
62
        return $this->lineLastLogin;
63
    }
64
65
    /**
66
     * @param \DateTimeImmutable $lineLastLogin
67
     */
68
    public function setLineLastLogin(\DateTimeImmutable $lineLastLogin = null)
69
    {
70
        $this->lineLastLogin = $lineLastLogin;
71
    }
72
73
    /**
74
     * @return array
75
     */
76
    public function getState()
77
    {
78
        return $this->state;
79
    }
80
81
    /**
82
     * @param array $state
83
     */
84
    public function setState(array $state)
85
    {
86
        $this->state = $state;
87
    }
88
}
89