GetMessages::getMandatoryFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace leocata\M1\Methods\Request;
4
5
use leocata\M1\Abstracts\RequestMethods;
6
7
/**
8
 * Get list of messages
9
 * Class GetMessages.
10
 */
11
class GetMessages extends RequestMethods
12
{
13
    /**
14
     * Query of sessions with activity within specified time period.
15
     */
16
    const PERIOD_ALL_TIME = 0;
17
    const PERIOD_LAST_MONTH = 1;
18
    const PERIOD_LAST_WEEK = 2;
19
    const PERIOD_LAST_DAY = 3;
20
21
    /**
22
     * Message type.
23
     */
24
    const MESSAGE_TEXT = 0;
25
    const MESSAGE_FILE_LINK = 2;
26
    const MESSAGE_ADD_CONFERENCE = 3;
27
    const MESSAGE_DELETE_CONFERENCE = 4;
28
    const MESSAGE_CONTACT_LINK = 10;
29
30
    /**
31
     * Message status.
32
     */
33
    const MESSAGE_STATUS_INCOMING_NEW = 1;
34
    const MESSAGE_STATUS_INCOMING_OUTCOMING = 2;
35
    const MESSAGE_STATUS_OUTCOMING_UNREAD = 3;
36
    const MESSAGE_STATUS_OUTCOMING_OUTCOMING = 4;
37
38
    /**
39
     * Session identifier.
40
     *
41
     * @var string
42
     */
43
    public $sessionid;
44
45
    /**
46
     * Time period.
47
     *
48
     * Query of sessions with activity within specified time period:
49
     *  - 0 for all time
50
     *  - 1 for the past year
51
     *  - 2 for the last month
52
     *  - 3 for the last week
53
     *  - 4 for the last twenty-four hours
54
     *
55
     * @var int
56
     */
57
    public $period;
58
59
    /**
60
     * Timestamp with sampling (in milliseconds since 01.01.1970).
61
     *
62
     * @var int
63
     */
64
    public $since;
65
66
    /**
67
     * Number of entries in the sample. If "limit" is absent or equal to zero, entries
68
     * are chosen in timestamp’s ascending order(from " since" till now) Otherwise - from "since" in descending order.
69
     *
70
     * @var int
71
     */
72
    public $limit;
73
74
    /**
75
     * GetMessages constructor.
76
     */
77
    public function __construct()
78
    {
79
        if ($this->period && $this->since === null) {
80
            $this->since = strtotime('-24 hour');
81
        }
82
    }
83
84
    public function getMandatoryFields(): array
85
    {
86
        return [];
87
    }
88
}
89