| Total Complexity | 6 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class ChatStatisticsMessageInteractionCounters extends TdObject |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'chatStatisticsMessageInteractionCounters'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Message identifier. |
||
| 20 | * |
||
| 21 | * @var int |
||
| 22 | */ |
||
| 23 | protected int $messageId; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Number of times the message was viewed. |
||
| 27 | * |
||
| 28 | * @var int |
||
| 29 | */ |
||
| 30 | protected int $viewCount; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Number of times the message was forwarded. |
||
| 34 | * |
||
| 35 | * @var int |
||
| 36 | */ |
||
| 37 | protected int $forwardCount; |
||
| 38 | |||
| 39 | public function __construct(int $messageId, int $viewCount, int $forwardCount) |
||
| 44 | } |
||
| 45 | |||
| 46 | public static function fromArray(array $array): ChatStatisticsMessageInteractionCounters |
||
| 47 | { |
||
| 48 | return new static( |
||
| 49 | $array['message_id'], |
||
| 50 | $array['view_count'], |
||
| 51 | $array['forward_count'], |
||
| 52 | ); |
||
| 53 | } |
||
| 54 | |||
| 55 | public function typeSerialize(): array |
||
| 56 | { |
||
| 57 | return [ |
||
| 58 | '@type' => static::TYPE_NAME, |
||
| 59 | 'message_id' => $this->messageId, |
||
| 60 | 'view_count' => $this->viewCount, |
||
| 61 | 'forward_count' => $this->forwardCount, |
||
| 62 | ]; |
||
| 63 | } |
||
| 64 | |||
| 65 | public function getMessageId(): int |
||
| 66 | { |
||
| 67 | return $this->messageId; |
||
| 68 | } |
||
| 69 | |||
| 70 | public function getViewCount(): int |
||
| 71 | { |
||
| 72 | return $this->viewCount; |
||
| 73 | } |
||
| 74 | |||
| 75 | public function getForwardCount(): int |
||
| 78 | } |
||
| 79 | } |
||
| 80 |