forked from pionl/METno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMETnoCustomSymbol.php
47 lines (42 loc) · 1.2 KB
/
METnoCustomSymbol.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* @author Martin Kluska @ iMakers, s.r.o. <martin.kluska@imakers.cz>
* @copyright iMakers, s.r.o.
* @copyright Martin Kluska
* @web http://imakers.cz
*
*
* Symbol documentation (string in lower case):
* @link http://api.met.no/weatherapi/weathericon/1.0/documentation
*/
class METnoCustomSymbol extends METnoSymbol {
static protected $fileFormat = ".png";
/**
* Sets file format (extension) without dot
* @param type $fileFormat
*/
static public function setFileFormat($fileFormat) {
if ($fileFormat != "") {
self::$fileFormat = ".$fileFormat";
} else {
self::$fileFormat = $fileFormat;
}
}
/**
* Returns global file format for icon
* @return type
*/
static public function getFileFormat() {
return self::$fileFormat;
}
/**
* Return url of the image with defined file format
*
* @link http://api.met.no/weatherapi/weathericon/1.0/documentation
* @return string NUMBER-LOWERED_NAME.FILE_FORMAT
*/
public function getUrl() {
return $this->number."-".strtolower($this->name).METnoCustomSymbol::getFileFormat();
}
}
?>