summaryrefslogtreecommitdiff
path: root/src/ResponseMessage.php
blob: fa54c296eecc75a9ec6c3f7fdf74890e559586db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php

namespace jobd;

class ResponseMessage extends Message {

    protected $error;
    protected $data;

    /**
     * Response constructor.
     * @param null $error
     * @param null $data
     */
    public function __construct($error = null, $data = null) {
        parent::__construct(Message::RESPONSE);

        $this->error = $error;
        $this->data = $data;
    }

    /**
     * @return array
     */
    public function getContent(): array {
        return [$this->error, $this->data];
    }

    /**
     * @return mixed
     */
    public function getError() {
        return $this->error;
    }

    /**
     * @return mixed
     */
    public function getData() {
        return $this->data;
    }

}