Revision::getId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Queryr\DumpReader;
4
5
/**
6
 * @licence GNU GPL v2+
7
 * @author Jeroen De Dauw < [email protected] >
8
 */
9
class Revision {
10
11
	private $id;
12
	private $model;
13
	private $format;
14
	private $text;
15
	private $timeStamp;
16
17
	/**
18
	 * @param string|int $id
19
	 * @param string $model
20
	 * @param string $format
21
	 * @param string $text
22
	 * @param string $timeStamp
23
	 */
24
	public function __construct( $id, $model, $format, $text, $timeStamp ) {
25
		$this->id = (int)$id;
26
		$this->model = $model;
27
		$this->format = $format;
28
		$this->text = $text;
29
		$this->timeStamp = $timeStamp;
30
	}
31
32
	/**
33
	 * @return int
34
	 */
35
	public function getId() {
36
		return $this->id;
37
	}
38
39
	/**
40
	 * @return string
41
	 */
42
	public function getModel() {
43
		return $this->model;
44
	}
45
46
	/**
47
	 * @return string
48
	 */
49
	public function getFormat() {
50
		return $this->format;
51
	}
52
53
	/**
54
	 * @return string
55
	 */
56
	public function getText() {
57
		return $this->text;
58
	}
59
60
	/**
61
	 * @return string
62
	 */
63
	public function getTimeStamp() {
64
		return $this->timeStamp;
65
	}
66
67
	/**
68
	 * @return bool
69
	 */
70
	public function hasEntityModel() {
71
		return $this->model === 'wikibase-item' || $this->model === 'wikibase-property';
72
	}
73
74
}
75