Completed
Push — master ( 5a94c7...652f62 )
by Tomas Norre
02:53
created

GolfCourse::getCountryShortEnName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
ccs 1
cts 1
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
namespace TNM\GolfCourses\Domain\Model;
3
4
/***************************************************************
5
 *
6
 *  Copyright notice
7
 *
8
 *  (c) 2016 Tomas Norre Mikkelsen <[email protected]>
9
 *
10
 *  All rights reserved
11
 *
12
 *  This script is part of the TYPO3 project. The TYPO3 project is
13
 *  free software; you can redistribute it and/or modify
14
 *  it under the terms of the GNU General Public License as published by
15
 *  the Free Software Foundation; either version 3 of the License, or
16
 *  (at your option) any later version.
17
 *
18
 *  The GNU General Public License can be found at
19
 *  http://www.gnu.org/copyleft/gpl.html.
20
 *
21
 *  This script is distributed in the hope that it will be useful,
22
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
 *  GNU General Public License for more details.
25
 *
26
 *  This copyright notice MUST APPEAR in all copies of the script!
27
 ***************************************************************/
28
use SJBR\StaticInfoTables\Domain\Model\Country;
29
30
/**
31
 * GolfCourse
32
 */
33
class GolfCourse extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
34
{
35
36
    /**
37
     * name
38
     *
39
     * @var string
40
     */
41
    protected $name = '';
42
    
43
    /**
44
     * website
45
     *
46
     * @var string
47
     */
48
    protected $website = '';
49
    
50
    /**
51
     * comment
52
     *
53
     * @var string
54
     */
55
    protected $comment = '';
56
    
57
    /**
58
     * country
59
     *
60
     * @var int
61
     */
62
    protected $country = 0;
63
    
64
    /**
65
     * logo
66
     *
67
     * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
68
     */
69
    protected $logo = null;
70
71
    /**
72
     * @var string
73
     */
74
    protected $longitude = '';
75
76 1
    /**
77
     * @var string
78 1
     */
79
    protected $latitude = '';
80
81
    /**
82
     * @var \SJBR\StaticInfoTables\Domain\Repository\CountryRepository
83
     * @inject
84
     */
85
    protected $countryRepository;
86
87 1
    /**
88
     * Returns the name
89 1
     *
90 1
     * @return string $name
91
     */
92
    public function getName()
93
    {
94
        return $this->name;
95
    }
96
    
97 1
    /**
98
     * Sets the name
99 1
     *
100
     * @param string $name
101
     * @return void
102
     */
103
    public function setName($name)
104
    {
105
        $this->name = $name;
106
    }
107
    
108 1
    /**
109
     * Returns the website
110 1
     *
111 1
     * @return string $website
112
     */
113
    public function getWebsite()
114
    {
115
        return $this->website;
116
    }
117
    
118 1
    /**
119
     * Sets the website
120 1
     *
121
     * @param string $website
122
     * @return void
123
     */
124
    public function setWebsite($website)
125
    {
126
        $this->website = $website;
127
    }
128
    
129 1
    /**
130
     * Returns the comment
131 1
     *
132 1
     * @return string $comment
133
     */
134
    public function getComment()
135
    {
136
        return $this->comment;
137
    }
138
    
139 2
    /**
140
     * Sets the comment
141 2
     *
142
     * @param string $comment
143
     * @return void
144
     */
145
    public function setComment($comment)
146
    {
147
        $this->comment = $comment;
148
    }
149
    
150 1
    /**
151
     * Returns the country
152 1
     *
153 1
     * @return int $country
154
     */
155
    public function getCountry()
156
    {
157
        return $this->country;
158
    }
159
    
160 1
    /**
161
     * Sets the country
162 1
     *
163
     * @param int $country
164
     * @return void
165
     */
166
    public function setCountry($country)
167
    {
168
        $this->country = $country;
169
    }
170
171 1
    /**
172
     * @return string
173 1
     */
174 1
    public function getCountryShortEnName()
175
    {
176
        /** @var Country $country */
177
        $country = $this->countryRepository->findByUid($this->country);
178
179
        return $country->getShortNameEn();
180
    }
181
182
    /**
183
     * Returns the logo
184
     *
185
     * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $logo
186
     */
187
    public function getLogo()
188
    {
189
        return $this->logo;
190
    }
191
    
192
    /**
193
     * Sets the logo
194
     *
195
     * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $logo
196
     * @return void
197
     */
198
    public function setLogo(\TYPO3\CMS\Extbase\Domain\Model\FileReference $logo)
199
    {
200
        $this->logo = $logo;
201
    }
202
203
    /**
204
     * @return string
205
     */
206
    public function getLongitude()
207
    {
208
        return $this->longitude;
209
    }
210
211
    /**
212
     * @param string $longitude
213
     */
214
    public function setLongitude($longitude)
215
    {
216
        $this->longitude = $longitude;
217
    }
218
219
    /**
220
     * @return string
221
     */
222
    public function getLatitude()
223
    {
224
        return $this->latitude;
225
    }
226
227
    /**
228
     * @param string $latitude
229
     */
230
    public function setLatitude($latitude)
231
    {
232
        $this->latitude = $latitude;
233
    }
234
235
236
}
237