@@ 156-179 (lines=24) @@ | ||
153 | /** |
|
154 | * @inheritdoc |
|
155 | */ |
|
156 | public function beforeRequest(RequestEvent $event) |
|
157 | { |
|
158 | switch ($event->requestData->getCommand()) { |
|
159 | case self::RC_SEND_SMS: |
|
160 | $this->trigger(self::EVENT_BEFORE_SEND_SMS); |
|
161 | break; |
|
162 | case self::RC_SEND_VOICE: |
|
163 | $this->trigger(self::EVENT_BEFORE_SEND_VOICE); |
|
164 | break; |
|
165 | case self::RC_GET_BALANCE: |
|
166 | $this->trigger(self::EVENT_BEFORE_GET_BALANCE); |
|
167 | break; |
|
168 | case self::RC_GET_SEND_STATUS: |
|
169 | $this->trigger(self::EVENT_BEFORE_GET_SEND_STATUS); |
|
170 | break; |
|
171 | case self::RC_GET_RECEIVER_STATUS: |
|
172 | $this->trigger(self::EVENT_BEFORE_GET_RECEIVER_STATUS); |
|
173 | break; |
|
174 | default: |
|
175 | break; |
|
176 | } |
|
177 | ||
178 | parent::beforeRequest($event); |
|
179 | } |
|
180 | ||
181 | /** |
|
182 | * @inheritdoc |
|
@@ 184-207 (lines=24) @@ | ||
181 | /** |
|
182 | * @inheritdoc |
|
183 | */ |
|
184 | public function afterRequest(RequestEvent $event) |
|
185 | { |
|
186 | switch ($event->requestData->getCommand()) { |
|
187 | case self::RC_SEND_SMS: |
|
188 | $this->trigger(self::EVENT_AFTER_SEND_SMS); |
|
189 | break; |
|
190 | case self::RC_SEND_VOICE: |
|
191 | $this->trigger(self::EVENT_AFTER_SEND_VOICE); |
|
192 | break; |
|
193 | case self::RC_GET_BALANCE: |
|
194 | $this->trigger(self::EVENT_AFTER_GET_BALANCE); |
|
195 | break; |
|
196 | case self::RC_GET_SEND_STATUS: |
|
197 | $this->trigger(self::EVENT_AFTER_GET_SEND_STATUS); |
|
198 | break; |
|
199 | case self::RC_GET_RECEIVER_STATUS: |
|
200 | $this->trigger(self::EVENT_AFTER_GET_RECEIVER_STATUS); |
|
201 | break; |
|
202 | default: |
|
203 | break; |
|
204 | } |
|
205 | ||
206 | parent::afterRequest($event); |
|
207 | } |
|
208 | ||
209 | /** |
|
210 | * Phương thức thực thi gửi sms. |