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