Venue::getId()   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
 * Describes a venue.
13
 */
14
class Venue extends TdObject
15
{
16
    public const TYPE_NAME = 'venue';
17
18
    /**
19
     * Venue location; as defined by the sender.
20
     *
21
     * @var Location
22
     */
23
    protected Location $location;
24
25
    /**
26
     * Venue name; as defined by the sender.
27
     *
28
     * @var string
29
     */
30
    protected string $title;
31
32
    /**
33
     * Venue address; as defined by the sender.
34
     *
35
     * @var string
36
     */
37
    protected string $address;
38
39
    /**
40
     * Provider of the venue database; as defined by the sender. Currently only "foursquare" needs to be supported.
41
     *
42
     * @var string
43
     */
44
    protected string $provider;
45
46
    /**
47
     * Identifier of the venue in the provider database; as defined by the sender.
48
     *
49
     * @var string
50
     */
51
    protected string $id;
52
53
    /**
54
     * Type of the venue in the provider database; as defined by the sender.
55
     *
56
     * @var string
57
     */
58
    protected string $type;
59
60
    public function __construct(Location $location, string $title, string $address, string $provider, string $id, string $type)
61
    {
62
        $this->location = $location;
63
        $this->title    = $title;
64
        $this->address  = $address;
65
        $this->provider = $provider;
66
        $this->id       = $id;
67
        $this->type     = $type;
68
    }
69
70
    public static function fromArray(array $array): Venue
71
    {
72
        return new static(
73
            TdSchemaRegistry::fromArray($array['location']),
74
            $array['title'],
75
            $array['address'],
76
            $array['provider'],
77
            $array['id'],
78
            $array['type'],
79
        );
80
    }
81
82
    public function typeSerialize(): array
83
    {
84
        return [
85
            '@type'    => static::TYPE_NAME,
86
            'location' => $this->location->typeSerialize(),
87
            'title'    => $this->title,
88
            'address'  => $this->address,
89
            'provider' => $this->provider,
90
            'id'       => $this->id,
91
            'type'     => $this->type,
92
        ];
93
    }
94
95
    public function getLocation(): Location
96
    {
97
        return $this->location;
98
    }
99
100
    public function getTitle(): string
101
    {
102
        return $this->title;
103
    }
104
105
    public function getAddress(): string
106
    {
107
        return $this->address;
108
    }
109
110
    public function getProvider(): string
111
    {
112
        return $this->provider;
113
    }
114
115
    public function getId(): string
116
    {
117
        return $this->id;
118
    }
119
120
    public function getType(): string
121
    {
122
        return $this->type;
123
    }
124
}
125