Completed
Push — master ( ef8ec4...4966f7 )
by WEBEWEB
01:23
created

ActionResponse::setStatus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Model;
13
14
use JsonSerializable;
15
16
/**
17
 * Action response.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Bundle\CoreBundle\Model
21
 */
22
class ActionResponse implements JsonSerializable {
23
24
    /**
25
     * Notify.
26
     *
27
     * @var string
28
     */
29
    private $notify;
30
31
    /**
32
     * Status.
33
     *
34
     * @var int
35
     */
36
    private $status;
37
38
    /**
39
     * Constructor.
40
     *
41
     * @param int $status The status.
42
     * @param string $notify The notify.
43
     */
44
    public function __construct($status = null, $notify = null) {
45
        $this->setNotify($notify);
46
        $this->setStatus($status);
47
    }
48
49
    /**
50
     * Get the notify.
51
     *
52
     * @return string Returns the notify.
53
     */
54
    public function getNotify() {
55
        return $this->notify;
56
    }
57
58
    /**
59
     * Get the status.
60
     *
61
     * @return int Returns the status.
62
     */
63
    public function getStatus() {
64
        return $this->status;
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function jsonSerialize() {
71
        return [
72
            "status" => $this->getStatus(),
73
            "notify" => $this->getNotify(),
74
        ];
75
    }
76
77
    /**
78
     * Set the notify.
79
     *
80
     * @param string $notify The notify.
81
     * @return ActionResponse Returns this action response.
82
     */
83
    public function setNotify($notify) {
84
        $this->notify = $notify;
85
        return $this;
86
    }
87
88
    /**
89
     * Set the status.
90
     *
91
     * @param int $status The status.
92
     * @return ActionResponse Returns this action response.
93
     */
94
    public function setStatus($status) {
95
        $this->status = $status;
96
        return $this;
97
    }
98
}
99