1 | <?php |
||
13 | class Request |
||
14 | { |
||
15 | const YANDEX_TRANSLATOR_VERSION = '1.5'; |
||
16 | |||
17 | const PLAIN_FORMAT = 'plain'; |
||
18 | const HTML_FORMAT = 'html'; |
||
19 | |||
20 | protected $client; |
||
21 | |||
22 | protected $key; |
||
23 | |||
24 | protected $from; |
||
25 | |||
26 | protected $to; |
||
27 | |||
28 | protected $text; |
||
29 | |||
30 | protected $format = self::PLAIN_FORMAT; |
||
31 | |||
32 | public function __construct(Client $client) |
||
36 | |||
37 | public function setClient(Client $client) |
||
41 | |||
42 | /** |
||
43 | * @return ClientInterface |
||
44 | */ |
||
45 | public function getClient() |
||
49 | |||
50 | /** |
||
51 | * @return mixed |
||
52 | */ |
||
53 | public function getKey() |
||
57 | |||
58 | /** |
||
59 | * @param mixed $key |
||
60 | * @return $this |
||
61 | */ |
||
62 | public function setKey($key) |
||
63 | { |
||
64 | $this->key = $key; |
||
65 | |||
66 | return $this; |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * @return mixed |
||
71 | */ |
||
72 | public function getFrom() |
||
76 | |||
77 | /** |
||
78 | * @param mixed $from |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function setFrom($from) |
||
82 | { |
||
83 | $this->from = $from; |
||
84 | |||
85 | return $this; |
||
86 | } |
||
87 | |||
88 | /** |
||
89 | * @return mixed |
||
90 | */ |
||
91 | public function getTo() |
||
95 | |||
96 | /** |
||
97 | * @param mixed $to |
||
98 | * @return $this |
||
99 | */ |
||
100 | public function setTo($to) |
||
101 | { |
||
102 | $this->to = $to; |
||
103 | |||
104 | return $this; |
||
105 | } |
||
106 | |||
107 | /** |
||
108 | * @return mixed |
||
109 | */ |
||
110 | public function getText() |
||
114 | |||
115 | /** |
||
116 | * @param mixed $text |
||
117 | * @return $this |
||
118 | */ |
||
119 | public function setText($text) |
||
125 | |||
126 | public function useHtml() |
||
132 | |||
133 | public function send() |
||
153 | } |
||
154 |