SettingsService.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. namespace Core\App\Service;
  3. class SettingsService
  4. {
  5. protected $settingsRepository;
  6. public function __construct(
  7. \Core\App\Repository\Marketplace\SettingsInterface $settingsRepository
  8. )
  9. {
  10. $this->settingsRepository = $settingsRepository;
  11. }
  12. public function getSyncDataTypes()
  13. {
  14. return $this->settingsRepository->getSyncDataTypes();
  15. }
  16. public function getPdlGestiuni(\Core\App\Repository\Facturis\StockInterface $facturisStockRepository)
  17. {
  18. return $facturisStockRepository->getPdlGestiuni();
  19. }
  20. public function getOptions()
  21. {
  22. return $this->settingsRepository->getSyncOptions();
  23. }
  24. public function getAuth()
  25. {
  26. return $this->settingsRepository->getSyncAuth();
  27. }
  28. public function testAuth(\Core\App\Repository\Facturis\StockInterface $facturisStockRepository)
  29. {
  30. $facturisStockRepository->testAuth();
  31. }
  32. public function getVersionLink()
  33. {
  34. return $this->settingsRepository->getVersionLink();
  35. }
  36. public function getVersion()
  37. {
  38. return $this->settingsRepository->getVersion();
  39. }
  40. public function getSyncOrdersAs()
  41. {
  42. return $this->settingsRepository->getSyncOrdersAs();
  43. }
  44. public function getAutoSyncOptions()
  45. {
  46. return $this->settingsRepository->getAutoSyncOptions();
  47. }
  48. public function getEnabledDisabledOptions()
  49. {
  50. return $this->settingsRepository->getEnabledDisabledOptions();
  51. }
  52. public function showTutorial()
  53. {
  54. $authData = $this->settingsRepository->getSyncAuth();
  55. if(
  56. empty($authData['fsync_auth_apikey']) ||
  57. empty($authData['fsync_auth_username']) ||
  58. empty($authData['fsync_auth_password']) ||
  59. empty($authData['fsync_auth_fiscalcode'])
  60. )
  61. {
  62. return true;
  63. }
  64. else
  65. {
  66. return false;
  67. }
  68. }
  69. public function checkLatestVersion($language)
  70. {
  71. $this->settingsRepository->checkLatestVersion($language);
  72. }
  73. }