1 | <?php |
||
53 | class Client implements EventManagerAwareInterface |
||
54 | { |
||
55 | |||
56 | /** |
||
57 | * Eventmanager. |
||
58 | * |
||
59 | * @var EventManagerInterface |
||
60 | */ |
||
61 | protected $eventManager; |
||
62 | |||
63 | /** |
||
64 | * Options. |
||
65 | * |
||
66 | * @var Options |
||
67 | */ |
||
68 | protected $options; |
||
69 | |||
70 | /** |
||
71 | * @var ConnectionInterface |
||
72 | */ |
||
73 | protected $connection; |
||
74 | |||
75 | /** |
||
76 | * Constructor. |
||
77 | * |
||
78 | * @param Options $options Client options |
||
79 | * @param EventManagerInterface $eventManager Event manager |
||
80 | */ |
||
81 | 6 | public function __construct(Options $options, EventManagerInterface $eventManager = null) |
|
100 | |||
101 | /** |
||
102 | * Setup implementation. |
||
103 | * |
||
104 | * @return void |
||
105 | */ |
||
106 | 3 | protected function setupImplementation() |
|
118 | |||
119 | /** |
||
120 | * Connect to server. |
||
121 | * |
||
122 | * @return void |
||
123 | */ |
||
124 | 3 | public function connect() |
|
128 | |||
129 | /** |
||
130 | * Disconnect from server. |
||
131 | * |
||
132 | * @return void |
||
133 | */ |
||
134 | 3 | public function disconnect() |
|
138 | |||
139 | /** |
||
140 | * Send data to server. |
||
141 | * |
||
142 | * @param ProtocolImplementationInterface $interface Interface |
||
143 | * @return void |
||
144 | */ |
||
145 | 3 | public function send(ProtocolImplementationInterface $interface) |
|
150 | |||
151 | /** |
||
152 | * {@inheritDoc} |
||
153 | */ |
||
154 | 3 | public function getEventManager() |
|
158 | |||
159 | /** |
||
160 | * {@inheritDoc} |
||
161 | */ |
||
162 | 3 | public function setEventManager(EventManagerInterface $eventManager) |
|
167 | |||
168 | /** |
||
169 | * Get options. |
||
170 | * |
||
171 | * @return Options |
||
172 | */ |
||
173 | 3 | public function getOptions() |
|
177 | |||
178 | /** |
||
179 | * @return ConnectionInterface |
||
180 | */ |
||
181 | 3 | public function getConnection() |
|
185 | } |
||
186 |