DeleteAccountDataProvider.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\App\UI\Client\EmailAccount\Providers;
  3. use ThurData\Servers\KerioEmail\App\Helpers\KerioManager;
  4. use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
  5. use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Services\Delete\DeleteAccount;
  6. use ThurData\Servers\KerioEmail\Core\UI\ResponseTemplates\HtmlDataJsonResponse;
  7. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\DataProviders\BaseDataProvider;
  8. /**
  9. *
  10. * Created by PhpStorm.
  11. * User: ThurData
  12. * Date: 18.09.19
  13. * Time: 11:28
  14. * Class DeleteAccountDataProvider
  15. */
  16. class DeleteAccountDataProvider extends BaseDataProvider
  17. {
  18. public function read()
  19. {
  20. $this->data['id'] = $this->actionElementId;
  21. }
  22. public function update()
  23. {
  24. // TODO: Implement update() method.
  25. }
  26. public function delete()
  27. {
  28. /**
  29. * hosting id
  30. */
  31. $hid = $this->request->get('id');
  32. /**
  33. * product manager allow to check product settings
  34. */
  35. $productManager = new ProductManager();
  36. $productManager->loadByHostingId($hid);
  37. logModuleCall(
  38. 'kerioEmail',
  39. __FUNCTION__,
  40. $this->formData,
  41. 'Debug Error',
  42. $this->data
  43. );
  44. return (new HtmlDataJsonResponse())->setMessageAndTranslate('emailAccountHasBeenDeleted')->setStatusSuccess();
  45. }
  46. public function massDelete()
  47. {
  48. /**
  49. * hosting id
  50. */
  51. $hid = $this->request->get('id');
  52. /**
  53. * product manager allow to check product settings
  54. */
  55. $productManager = new ProductManager();
  56. $productManager->loadByHostingId($hid);
  57. /**
  58. *
  59. */
  60. foreach($this->request->get('massActions') as $id)
  61. {
  62. }
  63. return (new HtmlDataJsonResponse())->setMessageAndTranslate('massEmailAccountHasBeenDeleted')->setStatusSuccess();
  64. }
  65. }