PushMessageContentMediaAlbum::getHasVideos()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This phpFile is auto-generated.
5
 */
6
7
declare(strict_types=1);
8
9
namespace AurimasNiekis\TdLibSchema;
10
11
/**
12
 * A media album.
13
 */
14
class PushMessageContentMediaAlbum extends PushMessageContent
15
{
16
    public const TYPE_NAME = 'pushMessageContentMediaAlbum';
17
18
    /**
19
     * Number of messages in the album.
20
     *
21
     * @var int
22
     */
23
    protected int $totalCount;
24
25
    /**
26
     * True, if the album has at least one photo.
27
     *
28
     * @var bool
29
     */
30
    protected bool $hasPhotos;
31
32
    /**
33
     * True, if the album has at least one video.
34
     *
35
     * @var bool
36
     */
37
    protected bool $hasVideos;
38
39
    public function __construct(int $totalCount, bool $hasPhotos, bool $hasVideos)
40
    {
41
        parent::__construct();
42
43
        $this->totalCount = $totalCount;
44
        $this->hasPhotos  = $hasPhotos;
45
        $this->hasVideos  = $hasVideos;
46
    }
47
48
    public static function fromArray(array $array): PushMessageContentMediaAlbum
49
    {
50
        return new static(
51
            $array['total_count'],
52
            $array['has_photos'],
53
            $array['has_videos'],
54
        );
55
    }
56
57
    public function typeSerialize(): array
58
    {
59
        return [
60
            '@type'       => static::TYPE_NAME,
61
            'total_count' => $this->totalCount,
62
            'has_photos'  => $this->hasPhotos,
63
            'has_videos'  => $this->hasVideos,
64
        ];
65
    }
66
67
    public function getTotalCount(): int
68
    {
69
        return $this->totalCount;
70
    }
71
72
    public function getHasPhotos(): bool
73
    {
74
        return $this->hasPhotos;
75
    }
76
77
    public function getHasVideos(): bool
78
    {
79
        return $this->hasVideos;
80
    }
81
}
82