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 | * TranslationMatch constructor. |
||
49 | * @param $count |
||
50 | * @param $matchDegree |
||
51 | * @param $rating |
||
52 | * @param $translatedText |
||
53 | */ |
||
54 | 6 | public function __construct($count, $matchDegree, $rating, $translatedText, $error = null) |
|
62 | |||
63 | /** |
||
64 | * @param \SimpleXMLElement $xml |
||
65 | * @return TranslationMatch |
||
66 | */ |
||
67 | 6 | public static function fromXmlElement(\SimpleXMLElement $xml) |
|
76 | |||
77 | /** |
||
78 | * @return string |
||
79 | */ |
||
80 | 3 | public function getTranslatedText() |
|
84 | |||
85 | /** |
||
86 | * @return int |
||
87 | */ |
||
88 | 3 | public function getMatchDegree() |
|
92 | |||
93 | /** |
||
94 | * @return int |
||
95 | */ |
||
96 | 3 | public function getRating() |
|
100 | |||
101 | /** |
||
102 | * @return int |
||
103 | */ |
||
104 | 3 | public function getCount() |
|
108 | |||
109 | /** |
||
110 | * @return null|string |
||
111 | */ |
||
112 | 3 | public function getError() |
|
116 | } |