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

ImageNode::getLoc()   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 Image
5
 */
6
7
namespace FRUIT\GoogleServices\Domain\Model\Node;
8
9
use FRUIT\GoogleServices\Domain\Model\AbstractModel;
10
11
/**
12
 * Sitemap Image
13
 */
14
class ImageNode extends AbstractModel
15
{
16
17
    /**
18
     * Location
19
     *
20
     * @var string
21
     */
22
    protected $loc;
23
24
    /**
25
     * Caption
26
     *
27
     * @var string
28
     */
29
    protected $caption;
30
31
    /**
32
     * Title
33
     *
34
     * @var string
35
     */
36
    protected $title;
37
38
    /**
39
     * License
40
     *
41
     * @var string
42
     */
43
    protected $license;
44
45
    /**
46
     * Get location
47
     *
48
     * @return string
49
     */
50
    public function getLoc()
51
    {
52
        return $this->loc;
53
    }
54
55
    /**
56
     * Get caption
57
     *
58
     * @return string
59
     */
60
    public function getCaption()
61
    {
62
        return $this->caption;
63
    }
64
65
    /**
66
     * Get title
67
     *
68
     * @return string
69
     */
70
    public function getTitle()
71
    {
72
        return $this->title;
73
    }
74
75
    /**
76
     * Get license
77
     *
78
     * @return string
79
     */
80
    public function getLicense()
81
    {
82
        return $this->license;
83
    }
84
85
    /**
86
     * Set location
87
     *
88
     * @param string $loc
89
     *
90
     * @throws \Exception
91
     */
92
    public function setLoc($loc)
93
    {
94
        if (!filter_var($loc, FILTER_VALIDATE_URL)) {
95
            throw new \Exception('The location of a google sitemap has have to be a valid URL');
96
        }
97
        $this->loc = $loc;
98
    }
99
100
    /**
101
     * Set caption
102
     *
103
     * @param string $caption
104
     */
105
    public function setCaption($caption)
106
    {
107
        $this->caption = $caption;
108
    }
109
110
    /**
111
     * Set title
112
     *
113
     * @param string $title
114
     */
115
    public function setTitle($title)
116
    {
117
        $this->title = $title;
118
    }
119
120
    /**
121
     * Set license
122
     *
123
     * @param string $license
124
     */
125
    public function setLicense($license)
126
    {
127
        $this->license = $license;
128
    }
129
}
130