File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,26 @@ public function __destruct() {
187
187
$ this ->disconnect ();
188
188
}
189
189
190
+ /**
191
+ * Clone the current Client instance
192
+ *
193
+ * @return Client
194
+ */
195
+ public function clone (): Client {
196
+ $ client = new self ();
197
+ $ client ->events = $ this ->events ;
198
+ $ client ->timeout = $ this ->timeout ;
199
+ $ client ->active_folder = $ this ->active_folder ;
200
+ $ client ->default_account_config = $ this ->default_account_config ;
201
+ $ config = $ this ->getAccountConfig ();
202
+ foreach ($ config as $ key => $ value ) {
203
+ $ client ->setAccountConfig ($ key , $ config , $ this ->default_account_config );
204
+ }
205
+ $ client ->default_message_mask = $ this ->default_message_mask ;
206
+ $ client ->default_attachment_mask = $ this ->default_message_mask ;
207
+ return $ client ;
208
+ }
209
+
190
210
/**
191
211
* Set the Client configuration
192
212
* @param array $config
You can’t perform that action at this time.
0 commit comments