1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | |
7: | namespace Aurora\Modules\MailMultiAccountsPlugin; |
8: | |
9: | |
10: | |
11: | |
12: | |
13: | class Manager extends \Aurora\Modules\Mail\Managers\Accounts\Manager |
14: | { |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | public function createAccount(\Aurora\Modules\Mail\Models\MailAccount &$oAccount) |
21: | { |
22: | $bResult = false; |
23: | |
24: | if ($oAccount->validate()) { |
25: | if (!$this->isExists($oAccount)) { |
26: | if (!$oAccount->save()) { |
27: | throw new \Aurora\System\Exceptions\ManagerException(\Aurora\System\Exceptions\Errs::UserManager_AccountCreateFailed); |
28: | } |
29: | } else { |
30: | throw new \Aurora\System\Exceptions\ApiException(\Aurora\System\Notifications::AccountExists); |
31: | } |
32: | } |
33: | |
34: | $bResult = true; |
35: | |
36: | return $bResult; |
37: | } |
38: | } |
39: | |