1 | <?php |
||
20 | class TranslationMatch |
||
21 | { |
||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $error; |
||
26 | |||
27 | /** |
||
28 | * @var int |
||
29 | */ |
||
30 | protected $count; |
||
31 | |||
32 | /** |
||
33 | * @var int |
||
34 | */ |
||
35 | protected $matchDegree; |
||
36 | |||
37 | /** |
||
38 | * @var int |
||
39 | */ |
||
40 | protected $rating; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $translatedText; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $matchedOriginalText; |
||
51 | |||
52 | /** |
||
53 | * TranslationMatch constructor. |
||
54 | * @param $count |
||
55 | * @param $matchDegree |
||
56 | * @param $rating |
||
57 | * @param $translatedText |
||
58 | */ |
||
59 | 9 | public function __construct($count, $matchDegree, $rating, $translatedText, $matchedOriginalText = null, $error = null) |
|
68 | |||
69 | /** |
||
70 | * @param \SimpleXMLElement $xml |
||
71 | * @return TranslationMatch |
||
72 | */ |
||
73 | 9 | public static function fromXmlElement(\SimpleXMLElement $xml) |
|
83 | |||
84 | /** |
||
85 | * @return string |
||
86 | */ |
||
87 | 6 | public function getTranslatedText() |
|
91 | |||
92 | /** |
||
93 | * @return int |
||
94 | */ |
||
95 | 6 | public function getMatchDegree() |
|
99 | |||
100 | /** |
||
101 | * @return int |
||
102 | */ |
||
103 | 6 | public function getRating() |
|
107 | |||
108 | /** |
||
109 | * @return int |
||
110 | */ |
||
111 | 6 | public function getCount() |
|
115 | |||
116 | /** |
||
117 | * @return null|string |
||
118 | */ |
||
119 | 6 | public function getError() |
|
123 | |||
124 | 3 | public function getMatchedOriginalText() |
|
128 | } |
||
129 |