Completed
Push — master ( 014efc...9ead79 )
by Leo
02:34
created

GetMessages::getMandatoryFields()   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 0
1
<?php
2
3
namespace leocata\M1\Methods\Request;
4
5
use leocata\M1\Interfaces\MethodRequest;
6
use leocata\M1\Methods\MessageMethods;
7
8
/**
9
 * Get list of messages
10
 * Class GetMessages
11
 * @package leocata\M1\Methods
12
 */
13
class GetMessages extends MessageMethods implements MethodRequest
14
{
15
16
    /**
17
     * Session identifier.
18
     * @var string
19
     */
20
    public $sessionid;
21
22
    /**
23
     * Time period.
24
     *
25
     * Query of sessions with activity within specified time period:
26
     *  - 0 for all time
27
     *  - 1 for the past year
28
     *  - 2 for the last month
29
     *  - 3 for the last week
30
     *  - 4 for the last twenty-four hours
31
     *
32
     * @var integer
33
     */
34
    public $period;
35
36
    /**
37
     * Timestamp with sampling (in milliseconds since 01.01.1970).
38
     * @var integer
39
     */
40
    public $since;
41
42
    /**
43
     * Number of entries in the sample. If "limit" is absent or equal to zero, entries
44
     * are chosen in timestamp’s ascending order(from " since" till now) Otherwise - from "since" in descending order.
45
     * @var integer
46
     */
47
    public $limit;
48
49
    /**
50
     * GetMessages constructor.
51
     */
52
    public function __construct()
53
    {
54
        if ($this->period && $this->since === null) {
55
            $this->since = strtotime('-1 hour');
56
        }
57
        parent::__construct();
58
    }
59
60
    public function getMandatoryFields(): array
61
    {
62
        return [];
63
    }
64
65
    public function result()
66
    {
67
68
    }
69
}
70