Completed
Push — master ( 46f89e...ea4efb )
by Janusz
09:47
created

SmsIn::getContent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Ittoolspl\Smslabs\Entity;
4
5
class SmsIn
6
{
7
    private $id;
8
    private $count;
9
    private $content;
10
    private $numberTo;
11
    private $receiveTime;
12
    private $numberFrom;
13
    private $status;
14
15
    /**
16
     * SmsIn constructor.
17
     * @param string $id
18
     * @param int $count
19
     * @param string $content
20
     * @param string $numberTo
21
     * @param int $receiveTime
22
     * @param string $numberFrom
23
     * @param int $status
24
     */
25
    public function __construct($id, $count, $content, $numberTo, $receiveTime, $numberFrom, $status)
26
    {
27
        $receiveTimeDT = new \DateTime();
28
        $receiveTimeDT->setTimestamp($receiveTime);
29
30
        $this->id          = $id;
31
        $this->count       = $count;
32
        $this->content     = $content;
33
        $this->numberTo    = $numberTo;
34
        $this->receiveTime = $receiveTimeDT;
35
        $this->numberFrom  = $numberFrom;
36
        $this->status      = $status;
37
    }
38
39
    public static function createFromResponseObject(\stdClass $respObj)
40
    {
41
        return new self(
42
            $respObj->_id,
43
            $respObj->s_cnt,
44
            $respObj->s_con,
45
            $respObj->no_to,
46
            $respObj->in_t,
47
            $respObj->no_fr,
48
            $respObj->stat
49
        );
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getId()
56
    {
57
        return $this->id;
58
    }
59
60
    /**
61
     * @return int
62
     */
63
    public function getCount()
64
    {
65
        return $this->count;
66
    }
67
68
    /**
69
     * @return string
70
     */
71
    public function getContent()
72
    {
73
        return $this->content;
74
    }
75
76
    /**
77
     * @return string
78
     */
79
    public function getNumberTo()
80
    {
81
        return $this->numberTo;
82
    }
83
84
    /**
85
     * @return \DateTime
86
     */
87
    public function getReceiveTime()
88
    {
89
        return $this->receiveTime;
90
    }
91
92
    /**
93
     * @return string
94
     */
95
    public function getNumberFrom()
96
    {
97
        return $this->numberFrom;
98
    }
99
100
    /**
101
     * @return int
102
     */
103
    public function getStatus()
104
    {
105
        return $this->status;
106
    }
107
}
108