Completed
Push — master ( c48ac2...909c9d )
by Tim
14:12
created

GeoNode::getFormat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Sitemap Geo node
5
 */
6
7
namespace FRUIT\GoogleServices\Domain\Model\Node;
8
9
use FRUIT\GoogleServices\Domain\Model\AbstractModel;
10
use TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentValueException;
11
12
/**
13
 * Sitemap Geo
14
 */
15
class GeoNode extends AbstractModel
16
{
17
18
    /**
19
     * The Geo format: kml, kmz or georss
20
     *
21
     * @var string
22
     */
23
    protected $format;
24
25
    /**
26
     * Get format
27
     *
28
     * @return string
29
     */
30
    public function getFormat()
31
    {
32
        return $this->format;
33
    }
34
35
    /**
36
     * Set format
37
     *
38
     * @param string $format
39
     *
40
     * @throws InvalidArgumentValueException
41
     */
42
    public function setFormat($format)
43
    {
44
        $format = strtolower($format);
45
        if (!in_array($format, [
46
            'kml',
47
            'kmz',
48
            'georss'
49
        ])
50
        ) {
51
            throw new InvalidArgumentValueException(
52
                '$format have to be kml, kmz or georss',
53
                23479823479283
54
            );
55
        }
56
        $this->format = $format;
57
    }
58
}
59