summaryrefslogtreecommitdiff
blob: b9b3104a741221cfd0c635576c88ca85a316d2ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
declare( strict_types = 1 );

namespace MediaWiki\Extension\Translate\TranslatorSandbox;

use Title;
use User;

/**
 * Value object for stashed translation which you can construct.
 *
 * @author Niklas Laxström
 * @license GPL-2.0-or-later
 * @since 2013.06 (namespaced in 2020.11)
 */
class StashedTranslation {
	/** @var User */
	protected $user;
	/** @var Title */
	protected $title;
	/** @var string */
	protected $value;
	/** @var array|null */
	protected $metadata;

	public function __construct( User $user, Title $title, string $value, array $metadata = null ) {
		$this->user = $user;
		$this->title = $title;
		$this->value = $value;
		$this->metadata = $metadata;
	}

	public function getUser(): User {
		return $this->user;
	}

	public function getTitle(): Title {
		return $this->title;
	}

	public function getValue(): string {
		return $this->value;
	}

	public function getMetadata(): ?array {
		return $this->metadata;
	}
}