Total Complexity | 5 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
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 |
||
63 | } |
||
64 | |||
65 | public function result() |
||
70 |