1: <?php
2:
3: namespace SMSApi\Api;
4:
5: /**
6: * Class ActionFactory
7: * @package SMSApi\Api
8: */
9: abstract class ActionFactory {
10:
11: /**
12: * @var \SMSApi\Client
13: */
14: protected $client = null;
15:
16: /**
17: * @var \SMSApi\Proxy\Proxy
18: */
19: protected $proxy = null;
20:
21: /**
22: * @param null $proxy
23: * @param null $client
24: */
25: public function __construct( $proxy = null, $client = null ) {
26:
27: if ( $proxy instanceof \SMSApi\Proxy\Proxy ) {
28: $this->setProxy( $proxy );
29: } else {
30: $this->setProxy( new \SMSApi\Proxy\Http\Native( 'https://ssl.smsapi.com/' ) );
31: }
32:
33: if ( $client instanceof \SMSApi\Client ) {
34: $this->setClient( $client );
35: }
36: }
37:
38: /**
39: * @param \SMSApi\Client $client
40: * @return $this
41: */
42: public function setClient( \SMSApi\Client $client ) {
43: $this->client = $client;
44: return $this;
45: }
46:
47: /**
48: * @param \SMSApi\Proxy\Proxy $proxy
49: * @return $this
50: */
51: public function setProxy( \SMSApi\Proxy\Proxy $proxy ) {
52: $this->proxy = $proxy;
53: return $this;
54: }
55:
56: /**
57: * @return \SMSApi\Client
58: */
59: public function getClient() {
60: return $this->client;
61: }
62:
63: /**
64: * @return \SMSApi\Proxy\Proxy
65: */
66: public function getProxy() {
67: return $this->proxy;
68: }
69:
70: }
71: