1: <?php
2:
3: namespace SMSApi\Api\Action\Mms;
4:
5: use SMSApi\Api\Action\AbstractAction;
6: use SMSApi\Proxy\Uri;
7:
8: /**
9: * Class Get
10: * @package SMSApi\Api\Action\Mms
11: */
12: class Get extends AbstractAction {
13:
14: /**
15: * @var \ArrayObject
16: */
17: private $id;
18:
19: function __construct() {
20: $this->id = new \ArrayObject();
21: }
22:
23: /**
24: * @param $data
25: * @return \SMSApi\Api\Response\StatusResponse
26: */
27: protected function response( $data ) {
28:
29: return new \SMSApi\Api\Response\StatusResponse( $data );
30: }
31:
32: /**
33: * @return Uri
34: */
35: public function uri() {
36:
37: $query = "";
38:
39: $query .= $this->paramsLoginToQuery();
40:
41: $query .= $this->paramsOther();
42:
43: $query .= "&status=" . implode( "|", $this->id->getArrayCopy() );
44:
45: return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/mms.do", $query );
46: }
47:
48: /**
49: * Set ID of messages to check.
50: *
51: * This id was returned after sending message.
52: *
53: * @param $id
54: * @return $this
55: * @throws \SMSApi\Exception\ActionException
56: */
57: public function filterById( $id ) {
58:
59: $this->id->append( $id );
60: return $this;
61: }
62:
63: /**
64: * Set IDs of messages to check.
65: *
66: * This id was returned after sending message.
67: *
68: * @param $ids
69: * @return $this
70: * @throws \SMSApi\Exception\ActionException
71: */
72: public function filterByIds( array $ids ) {
73:
74: $this->id->exchangeArray( $ids );
75: return $this;
76: }
77:
78: /**
79: * @deprecated since v1.0.0
80: */
81: public function ids($array) {
82: return $this->filterByIds($array);
83: }
84:
85: /**
86: * @deprecated since v1.0.0
87: */
88: public function id($id) {
89: return $this->filterById($id);
90: }
91:
92: }
93:
94: