| author | ymh <ymh.work@gmail.com> |
| Thu, 08 Dec 2011 23:48:55 +0100 | |
| changeset 58 | 87bf6ec8af90 |
| parent 43 | 54f204bceb28 |
| child 62 | 10be6b9e55e7 |
| permissions | -rwxr-xr-x |
| 2 | 1 |
<?php |
2 |
/* |
|
3 |
* This file is part of the WikiTagBundle package. |
|
4 |
* |
|
5 |
* (c) IRI <http://www.iri.centrepompidou.fr/> |
|
6 |
* |
|
7 |
* For the full copyright and license information, please view the LICENSE |
|
8 |
* file that was distributed with this source code. |
|
9 |
*/ |
|
10 |
namespace IRI\Bundle\WikiTagBundle\Model; |
|
11 |
||
|
14
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
12 |
use Doctrine\Common\Collections\ArrayCollection; |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
13 |
|
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
14 |
use IRI\Bundle\WikiTagBundle\Utils\WikiTagUtils; |
| 8 | 15 |
|
16 |
abstract class Tag implements TagInterface { |
|
| 2 | 17 |
|
| 58 | 18 |
public static $TAG_URL_STATUS_DICT = array('null_result'=>0,'redirection'=>1,'homonyme'=>2,'match'=>3, 'unsemantized'=>4); |
| 2 | 19 |
|
20 |
/** |
|
21 |
* @var integer $id |
|
22 |
*/ |
|
23 |
protected $id; |
|
24 |
||
25 |
/** |
|
26 |
* @var string $label |
|
27 |
*/ |
|
28 |
protected $label; |
|
29 |
||
30 |
/** |
|
31 |
* @var string $normalizedLabel |
|
32 |
*/ |
|
33 |
protected $normalizedLabel; |
|
34 |
||
35 |
/** |
|
36 |
* @var string $originalLabel |
|
37 |
*/ |
|
38 |
protected $originalLabel; |
|
|
42
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
39 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
40 |
/** |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
41 |
* @var $alternativeLabel |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
42 |
*/ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
43 |
protected $alternativeLabel; |
| 2 | 44 |
|
45 |
/** |
|
46 |
* @var string $alias |
|
47 |
*/ |
|
48 |
protected $alias; |
|
49 |
||
50 |
/** |
|
51 |
* @var string $wikipediaUrl |
|
52 |
*/ |
|
53 |
protected $wikipediaUrl; |
|
54 |
||
55 |
/** |
|
|
42
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
56 |
* @var string $alternativeWikipediaUrl |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
57 |
*/ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
58 |
protected $alternativeWikipediaUrl; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
59 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
60 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
61 |
/** |
| 2 | 62 |
* @var bigint $wikipediaPageId |
63 |
*/ |
|
64 |
protected $wikipediaPageId; |
|
65 |
||
|
42
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
66 |
/** |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
67 |
* @var bigint $alternativeWikipediaPageId |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
68 |
*/ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
69 |
protected $alternativeWikipediaPageId; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
70 |
|
| 2 | 71 |
/** |
72 |
* @var smallint $urlStatus |
|
73 |
*/ |
|
74 |
protected $urlStatus; |
|
75 |
||
76 |
/** |
|
77 |
* @var string $dbpediaUri |
|
78 |
*/ |
|
79 |
protected $dbpediaUri; |
|
80 |
||
81 |
/** |
|
82 |
* @var integer $popularity |
|
83 |
*/ |
|
84 |
protected $popularity = 0; |
|
85 |
||
86 |
/** |
|
87 |
* @var object $category |
|
88 |
*/ |
|
89 |
protected $category; |
|
90 |
||
|
14
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
91 |
/** |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
92 |
* @var ArrayCollection $documents |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
93 |
*/ |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
94 |
protected $documents; |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
95 |
|
| 2 | 96 |
|
97 |
/** |
|
98 |
* Get id |
|
99 |
* |
|
100 |
* @return integer |
|
101 |
*/ |
|
102 |
public function getId() |
|
103 |
{ |
|
104 |
return $this->id; |
|
105 |
} |
|
106 |
||
107 |
/** |
|
108 |
* Set label |
|
109 |
* |
|
110 |
* @param string $label |
|
111 |
*/ |
|
112 |
public function setLabel($label) |
|
113 |
{ |
|
114 |
$this->label = $label; |
|
| 8 | 115 |
$this->normalizedLabel = WikiTagUtils::normalizeTag($label); |
| 2 | 116 |
} |
117 |
||
118 |
/** |
|
119 |
* Get label |
|
120 |
* |
|
121 |
* @return string |
|
122 |
*/ |
|
123 |
public function getLabel() |
|
124 |
{ |
|
125 |
return $this->label; |
|
126 |
} |
|
127 |
||
128 |
/** |
|
129 |
* Set normalizedLabel |
|
130 |
* |
|
131 |
* @param string $normalizedLabel |
|
132 |
*/ |
|
133 |
public function setNormalizedLabel($normalizedLabel) |
|
134 |
{ |
|
135 |
$this->normalizedLabel = $normalizedLabel; |
|
136 |
} |
|
137 |
||
138 |
/** |
|
139 |
* Get normalizedLabel |
|
140 |
* |
|
141 |
* @return string |
|
142 |
*/ |
|
143 |
public function getNormalizedLabel() |
|
144 |
{ |
|
145 |
return $this->normalizedLabel; |
|
146 |
} |
|
147 |
||
148 |
/** |
|
149 |
* Set originalLabel |
|
150 |
* |
|
151 |
* @param string $originalLabel |
|
152 |
*/ |
|
153 |
public function setOriginalLabel($originalLabel) |
|
154 |
{ |
|
155 |
$this->originalLabel = $originalLabel; |
|
156 |
} |
|
157 |
||
158 |
/** |
|
159 |
* Get originalLabel |
|
160 |
* |
|
161 |
* @return string |
|
162 |
*/ |
|
163 |
public function getOriginalLabel() |
|
164 |
{ |
|
165 |
return $this->originalLabel; |
|
166 |
} |
|
167 |
||
168 |
/** |
|
|
42
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
169 |
* Set alternativeLabel |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
170 |
* |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
171 |
* @param string $alternativeLabel |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
172 |
*/ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
173 |
public function setAlternativeLabel($alternativeLabel) |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
174 |
{ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
175 |
$this->alternativeLabel = $alternativeLabel; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
176 |
} |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
177 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
178 |
/** |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
179 |
* Get alternativeLabel |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
180 |
* |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
181 |
* @return string |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
182 |
*/ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
183 |
public function getAlternativeLabel() |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
184 |
{ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
185 |
return $this->alternativeLabel; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
186 |
} |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
187 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
188 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
189 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
190 |
/** |
| 2 | 191 |
* Set alias |
192 |
* |
|
193 |
* @param string $alias |
|
194 |
*/ |
|
195 |
public function setAlias($alias) |
|
196 |
{ |
|
197 |
$this->alias = $alias; |
|
198 |
} |
|
199 |
||
200 |
/** |
|
201 |
* Get alias |
|
202 |
* |
|
203 |
* @return string |
|
204 |
*/ |
|
205 |
public function getAlias() |
|
206 |
{ |
|
207 |
return $this->alias; |
|
208 |
} |
|
209 |
||
210 |
/** |
|
211 |
* Set wikipediaUrl |
|
212 |
* |
|
213 |
* @param string $wikipediaUrl |
|
214 |
*/ |
|
215 |
public function setWikipediaUrl($wikipediaUrl) |
|
216 |
{ |
|
217 |
$this->wikipediaUrl = $wikipediaUrl; |
|
218 |
} |
|
219 |
||
220 |
/** |
|
221 |
* Get wikipediaUrl |
|
222 |
* |
|
223 |
* @return string |
|
224 |
*/ |
|
225 |
public function getWikipediaUrl() |
|
226 |
{ |
|
227 |
return $this->wikipediaUrl; |
|
228 |
} |
|
229 |
||
|
42
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
230 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
231 |
/** |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
232 |
* Set alternativeWikipediaUrl |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
233 |
* |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
234 |
* @param string $alternativeWikipediaUrl |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
235 |
*/ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
236 |
public function setAlternativeWikipediaUrl($alternativeWikipediaUrl) |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
237 |
{ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
238 |
$this->alternativeWikipediaUrl = $alternativeWikipediaUrl; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
239 |
} |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
240 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
241 |
/** |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
242 |
* Get alternativeWikipediaUrl |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
243 |
* |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
244 |
* @return string |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
245 |
*/ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
246 |
public function getAlternativeWikipediaUrl() |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
247 |
{ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
248 |
return $this->alternativeWikipediaUrl; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
249 |
} |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
250 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
251 |
|
| 2 | 252 |
/** |
253 |
* Set wikipediaPageId |
|
254 |
* |
|
255 |
* @param bigint $wikipediaPageId |
|
256 |
*/ |
|
257 |
public function setWikipediaPageId($wikipediaPageId) |
|
258 |
{ |
|
259 |
$this->wikipediaPageId = $wikipediaPageId; |
|
260 |
} |
|
261 |
||
262 |
/** |
|
263 |
* Get wikipediaPageId |
|
264 |
* |
|
265 |
* @return bigint |
|
266 |
*/ |
|
267 |
public function getWikipediaPageId() |
|
268 |
{ |
|
269 |
return $this->wikipediaPageId; |
|
270 |
} |
|
271 |
||
272 |
/** |
|
|
42
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
273 |
* Set alternativeWikipediaPageId |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
274 |
* |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
275 |
* @param bigint $alternativeWikipediaPageId |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
276 |
*/ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
277 |
function setAlternativeWikipediaPageId($alternativeWikipediaPageId) |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
278 |
{ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
279 |
$this->alternativeWikipediaPageId = $alternativeWikipediaPageId; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
280 |
} |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
281 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
282 |
/** |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
283 |
* Get alternativeWikipediaPageId |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
284 |
* |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
285 |
* @return bigint |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
286 |
*/ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
287 |
function getAlternativeWikipediaPageId() |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
288 |
{ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
289 |
return $this->alternativeWikipediaPageId; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
290 |
} |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
291 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
292 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
293 |
/** |
| 2 | 294 |
* Set urlStatus |
295 |
* |
|
296 |
* @param smallint $urlStatus |
|
297 |
*/ |
|
298 |
public function setUrlStatus($urlStatus) |
|
299 |
{ |
|
300 |
$this->urlStatus = $urlStatus; |
|
301 |
} |
|
302 |
||
303 |
/** |
|
304 |
* Get urlStatus |
|
305 |
* |
|
306 |
* @return smallint |
|
307 |
*/ |
|
308 |
public function getUrlStatus() |
|
309 |
{ |
|
310 |
return $this->urlStatus; |
|
311 |
} |
|
|
5
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
312 |
|
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
313 |
/** |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
314 |
* Get UrlStatusText |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
315 |
* |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
316 |
* @return string |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
317 |
*/ |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
318 |
public function getUrlStatusText() |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
319 |
{ |
| 58 | 320 |
if(is_null($this->getUrlStatus())) |
321 |
{ |
|
322 |
return null; |
|
323 |
} |
|
|
5
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
324 |
switch ($this->getUrlStatus()) { |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
325 |
case 0: |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
326 |
return "null_result"; |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
327 |
case 1: |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
328 |
return "redirection"; |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
329 |
case 2: |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
330 |
return "homonyme"; |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
331 |
case 3: |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
332 |
return "match"; |
| 58 | 333 |
case 4: |
334 |
return "unsemantized"; |
|
335 |
default: |
|
336 |
return ""; |
|
|
5
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
337 |
} |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
338 |
} |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
339 |
|
| 2 | 340 |
|
341 |
/** |
|
342 |
* Set dbpediaUri |
|
343 |
* |
|
344 |
* @param string $dbpediaUri |
|
345 |
*/ |
|
346 |
public function setDbpediaUri($dbpediaUri) |
|
347 |
{ |
|
348 |
$this->dbpediaUri = $dbpediaUri; |
|
349 |
} |
|
350 |
||
351 |
/** |
|
352 |
* Get dbpediaUri |
|
353 |
* |
|
354 |
* @return string |
|
355 |
*/ |
|
356 |
public function getDbpediaUri() |
|
357 |
{ |
|
358 |
return $this->dbpediaUri; |
|
359 |
} |
|
360 |
||
361 |
/** |
|
362 |
* Set popularity |
|
363 |
* |
|
364 |
* @param integer $popularity |
|
365 |
*/ |
|
366 |
public function setPopularity($popularity) |
|
367 |
{ |
|
368 |
$this->popularity = $popularity; |
|
369 |
} |
|
370 |
||
371 |
/** |
|
372 |
* Get popularity |
|
373 |
* |
|
374 |
* @return integer |
|
375 |
*/ |
|
376 |
public function getPopularity() |
|
377 |
{ |
|
378 |
return $this->popularity; |
|
379 |
} |
|
380 |
||
|
5
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
381 |
/** |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
382 |
* Set category |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
383 |
* |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
384 |
* @param object $category |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
385 |
*/ |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
386 |
public function setCategory($category) |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
387 |
{ |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
388 |
$this->category = $category; |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
389 |
} |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
390 |
|
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
391 |
/** |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
392 |
* Get category |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
393 |
* |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
394 |
* @return object |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
395 |
*/ |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
396 |
function getCategory() |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
397 |
{ |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
398 |
return $this->category; |
|
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
399 |
} |
|
14
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
400 |
|
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
401 |
/** |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
402 |
* Get Documents |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
403 |
* |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
404 |
* @return ArrayCollection |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
405 |
*/ |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
406 |
public function getDocuments() |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
407 |
{ |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
408 |
return $this->documents; |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
11
diff
changeset
|
409 |
} |
|
5
45378793512a
Correct tag insert + external id on doc
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
410 |
|
|
11
5f038a505cd7
Debug Category on tag list and document. Finish pagination for tag list.
cavaliet
parents:
8
diff
changeset
|
411 |
/** |
|
5f038a505cd7
Debug Category on tag list and document. Finish pagination for tag list.
cavaliet
parents:
8
diff
changeset
|
412 |
* Set category to Null |
|
5f038a505cd7
Debug Category on tag list and document. Finish pagination for tag list.
cavaliet
parents:
8
diff
changeset
|
413 |
* |
|
5f038a505cd7
Debug Category on tag list and document. Finish pagination for tag list.
cavaliet
parents:
8
diff
changeset
|
414 |
*/ |
|
5f038a505cd7
Debug Category on tag list and document. Finish pagination for tag list.
cavaliet
parents:
8
diff
changeset
|
415 |
function nullCategory() |
|
5f038a505cd7
Debug Category on tag list and document. Finish pagination for tag list.
cavaliet
parents:
8
diff
changeset
|
416 |
{ |
|
5f038a505cd7
Debug Category on tag list and document. Finish pagination for tag list.
cavaliet
parents:
8
diff
changeset
|
417 |
return $this->setCategory(NULL); |
|
5f038a505cd7
Debug Category on tag list and document. Finish pagination for tag list.
cavaliet
parents:
8
diff
changeset
|
418 |
} |
|
5f038a505cd7
Debug Category on tag list and document. Finish pagination for tag list.
cavaliet
parents:
8
diff
changeset
|
419 |
|
|
42
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
420 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
421 |
/** |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
422 |
* (non-PHPdoc) |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
423 |
* @see IRI\Bundle\WikiTagBundle\Model.TagInterface::setWikipediaInfo() |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
424 |
*/ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
425 |
function setWikipediaInfo($wikipedia_info) |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
426 |
{ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
427 |
$new_label = $wikipedia_info['new_label']; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
428 |
$status = $wikipedia_info['status']; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
429 |
$url = $wikipedia_info['wikipedia_url']; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
430 |
$pageid = $wikipedia_info['pageid']; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
431 |
$dbpedia_uri = $wikipedia_info["dbpedia_uri"]; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
432 |
$wikipedia_revision_id = $wikipedia_info['revision_id']; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
433 |
$alternative_label = array_key_exists('alternative_label', $wikipedia_info) ? $wikipedia_info['alternative_label'] : null; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
434 |
$alternative_url = array_key_exists('wikipedia_alternative_url', $wikipedia_info) ? $wikipedia_info['wikipedia_alternative_url'] : null; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
435 |
$alternative_pageid = array_key_exists('alternative_pageid', $wikipedia_info) ? $wikipedia_info['alternative_pageid'] : null; |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
436 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
437 |
# We save the datas |
| 43 | 438 |
if(! is_null($new_label)) |
|
42
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
439 |
{ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
440 |
$this->setLabel($new_label); |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
441 |
} |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
442 |
|
| 43 | 443 |
if(! is_null($status)) |
|
42
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
444 |
{ |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
445 |
$this->setUrlStatus($status); |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
446 |
} |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
447 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
448 |
$this->setWikipediaUrl($url); |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
449 |
$this->setWikipediaPageId($pageid); |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
450 |
$this->setDbpediaUri($dbpedia_uri); |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
451 |
$this->setAlternativeLabel($alternative_label); |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
452 |
$this->setAlternativeWikipediaUrl($alternative_url); |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
453 |
$this->setAlternativeWikipediaPageId($alternative_pageid); |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
454 |
|
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
455 |
} |
|
0e57c730bb18
Documentation and add alternative wp url and label + migrations
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
456 |
|
| 2 | 457 |
|
458 |
} |