ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilGeoLocation.php
Go to the documentation of this file.
1<?php
2
4
6 protected $id;
7
9 protected $title;
10
12 protected $latitude;
13
15 protected $longitude;
16
19
20 public function __construct(
21 int $a_id,
22 string $a_title,
23 float $a_latitude,
24 float $a_longitude,
25 \DateTimeImmutable $a_expiration_timestamp
26 ) {
27 $this->id = $a_id;
28 $this->title = $a_title;
29 // In a real world example we might want to conduct more checks on latitude
30 // and longitude here.
31 $this->latitude = $a_latitude;
32 $this->longitude = $a_longitude;
33 $this->expiration_timestamp = $a_expiration_timestamp;
34 }
35
36 public function getId() : int
37 {
38 return $this->id;
39 }
40
41 public function getTitle() : string
42 {
43 return $this->title;
44 }
45
46 public function getLatitude() : float
47 {
48 return $this->latitude;
49 }
50
51 public function getLongitude() : float
52 {
53 return $this->longitude;
54 }
55
56 public function getExpirationAsTimestamp() : float
57 {
58 return $this->expiration_timestamp->getTimestamp();
59 }
60
61 public function getExpirationAsImmutableDateTime() : \DateTimeImmutable
62 {
64 }
65}
An exception for terminatinating execution or to throw for unit testing.
__construct(int $a_id, string $a_title, float $a_latitude, float $a_longitude, \DateTimeImmutable $a_expiration_timestamp)
getExpirationAsImmutableDateTime()