| author | ymh <ymh.work@gmail.com> |
| Fri, 09 Dec 2011 06:43:49 +0100 | |
| changeset 62 | 10be6b9e55e7 |
| parent 57 | 186c4121c7b3 |
| child 83 | e9f04298bdfa |
| 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 |
||
11 |
namespace IRI\Bundle\WikiTagBundle\Model; |
|
12 |
||
13 |
abstract class DocumentTag implements DocumentTagInterface { |
|
14 |
||
15 |
/** |
|
16 |
* @var integer $id |
|
17 |
*/ |
|
18 |
protected $id; |
|
19 |
||
20 |
/** |
|
21 |
* @var integer $originalOrder |
|
22 |
*/ |
|
23 |
protected $originalOrder; |
|
24 |
||
25 |
/** |
|
26 |
* @var integer $tagOrder |
|
27 |
*/ |
|
28 |
protected $tagOrder; |
|
29 |
||
30 |
/** |
|
31 |
* @var float $indexNote |
|
32 |
*/ |
|
33 |
protected $indexNote = 0.0; |
|
34 |
||
35 |
/** |
|
36 |
* @var bigint $wikipediaRevisionId |
|
37 |
*/ |
|
38 |
protected $wikipediaRevisionId; |
|
39 |
||
40 |
/** |
|
41 |
* @var object $tag |
|
42 |
*/ |
|
43 |
protected $tag; |
|
44 |
||
45 |
/** |
|
46 |
* @var object $document |
|
47 |
*/ |
|
48 |
protected $document; |
|
49 |
||
50 |
||
|
62
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
51 |
/** |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
52 |
* @var DateTime |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
53 |
*/ |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
54 |
protected $createdAt; |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
55 |
|
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
56 |
/** |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
57 |
* |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
58 |
* construct the class |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
59 |
*/ |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
60 |
function __construct() |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
61 |
{ |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
62 |
$this->createdAt = new \DateTime("now", new \DateTimeZone('UTC')); |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
63 |
} |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
64 |
|
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
65 |
|
| 2 | 66 |
/** |
67 |
* Get id |
|
68 |
* |
|
69 |
* @return integer |
|
70 |
*/ |
|
71 |
public function getId() |
|
72 |
{ |
|
73 |
return $this->id; |
|
74 |
} |
|
75 |
||
76 |
/** |
|
77 |
* Set originalOrder |
|
78 |
* |
|
79 |
* @param integer $originalOrder |
|
80 |
*/ |
|
81 |
public function setOriginalOrder($originalOrder) |
|
82 |
{ |
|
83 |
$this->originalOrder = $originalOrder; |
|
84 |
} |
|
85 |
||
86 |
/** |
|
87 |
* Get originalOrder |
|
88 |
* |
|
89 |
* @return integer |
|
90 |
*/ |
|
91 |
public function getOriginalOrder() |
|
92 |
{ |
|
93 |
return $this->originalOrder; |
|
94 |
} |
|
95 |
||
96 |
/** |
|
97 |
* Set tagOrder |
|
98 |
* |
|
99 |
* @param integer $tagOrder |
|
100 |
*/ |
|
101 |
public function setTagOrder($tagOrder) |
|
102 |
{ |
|
103 |
$this->tagOrder = $tagOrder; |
|
104 |
} |
|
105 |
||
106 |
/** |
|
107 |
* Get tagOrder |
|
108 |
* |
|
109 |
* @return integer |
|
110 |
*/ |
|
111 |
public function getTagOrder() |
|
112 |
{ |
|
113 |
return $this->tagOrder; |
|
114 |
} |
|
115 |
||
116 |
/** |
|
117 |
* Set indexNote |
|
118 |
* |
|
119 |
* @param float $indexNote |
|
120 |
*/ |
|
121 |
public function setIndexNote($indexNote) |
|
122 |
{ |
|
123 |
$this->indexNote = $indexNote; |
|
124 |
} |
|
125 |
||
126 |
/** |
|
127 |
* Get indexNote |
|
128 |
* |
|
129 |
* @return float |
|
130 |
*/ |
|
131 |
public function getIndexNote() |
|
132 |
{ |
|
133 |
return $this->indexNote; |
|
134 |
} |
|
135 |
||
136 |
/** |
|
137 |
* Set wikipediaRevisionId |
|
138 |
* |
|
139 |
* @param bigint $wikipediaRevisionId |
|
140 |
*/ |
|
141 |
public function setWikipediaRevisionId($wikipediaRevisionId) |
|
142 |
{ |
|
143 |
$this->wikipediaRevisionId = $wikipediaRevisionId; |
|
144 |
} |
|
145 |
||
146 |
/** |
|
147 |
* Get wikipediaRevisionId |
|
148 |
* |
|
149 |
* @return bigint |
|
150 |
*/ |
|
151 |
public function getWikipediaRevisionId() |
|
152 |
{ |
|
153 |
return $this->wikipediaRevisionId; |
|
154 |
} |
|
155 |
||
156 |
/** |
|
157 |
* Set tag |
|
158 |
* |
|
159 |
* @param object $tag |
|
160 |
*/ |
|
161 |
public function setTag($tag) |
|
162 |
{ |
|
163 |
$this->tag = $tag; |
|
164 |
} |
|
165 |
||
166 |
/** |
|
167 |
* Get tag |
|
168 |
* |
|
169 |
* @return object |
|
170 |
*/ |
|
171 |
public function getTag() |
|
172 |
{ |
|
173 |
return $this->tag; |
|
174 |
} |
|
175 |
||
176 |
/** |
|
177 |
* Set document |
|
178 |
* |
|
179 |
* @param object $document |
|
180 |
*/ |
|
181 |
public function setDocument($document) |
|
182 |
{ |
|
183 |
$this->document = $document; |
|
184 |
} |
|
185 |
||
186 |
/** |
|
187 |
* Get document |
|
188 |
* |
|
189 |
* @return object |
|
190 |
*/ |
|
191 |
public function getDocument() |
|
192 |
{ |
|
193 |
return $this->document; |
|
194 |
} |
|
195 |
||
|
62
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
196 |
/** |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
197 |
* (non-PHPdoc) |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
198 |
* @see IRI\Bundle\WikiTagBundle\Model.DocumentTagInterface::getCreatedAt() |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
199 |
*/ |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
200 |
function getCreatedAt() |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
201 |
{ |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
202 |
return $this->createdAt; |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
203 |
} |
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
204 |
|
|
10be6b9e55e7
add creation timestamp on document tag and document tag
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
205 |
|
| 2 | 206 |
/** |
207 |
* Get wikipedia_version_permalink |
|
208 |
* |
|
209 |
* @return string |
|
210 |
*/ |
|
211 |
public function getWikipediaVersionPermalink() |
|
212 |
{ |
|
213 |
$WIKIPEDIA_VERSION_PERMALINK_TEMPLATE = "http://fr.wikipedia.org/w/index.php?oldid="; |
|
214 |
return $WIKIPEDIA_VERSION_PERMALINK_TEMPLATE.$this->wikipediaRevisionId; |
|
215 |
} |
|
216 |
||
|
57
186c4121c7b3
add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
217 |
|
|
186c4121c7b3
add service tp copy tag from one document to another
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
218 |
|
| 2 | 219 |
} |