Total Complexity | 4 |
Total Lines | 76 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
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 |
||
87 | } |
||
88 | } |
||
89 |