ClassOfServices.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace ModulesGarden\Servers\ZimbraEmail\App\Libs\Zimbra\Components\Api\Soap\Repository;
  3. use ModulesGarden\Servers\ZimbraEmail\App\Libs\Zimbra\Components\Api\Soap\Interfaces\AbstractApiClient;
  4. use ModulesGarden\Servers\ZimbraEmail\App\Libs\Zimbra\Components\Api\Soap\Interfaces\AbstractRepository;
  5. use ModulesGarden\Servers\ZimbraEmail\App\Libs\Zimbra\Components\Api\Soap\Models\ClassOfService as CosModel;
  6. /**
  7. *
  8. * Created by PhpStorm.
  9. * User: Tomasz Bielecki ( tomasz.bi@modulesgarden.com )
  10. * Date: 29.08.19
  11. * Time: 08:27
  12. * Class ClassOfServices
  13. */
  14. class ClassOfServices extends AbstractRepository
  15. {
  16. const CUSTOM_ZIMBRA = 'customMGzimbra';
  17. const ZIMBRA_CONFIG_OPTIONS = 'zimbraConfigurableOptions';
  18. const CLASS_OF_SERVICE_QUOTA = 'cosQuota';
  19. public function all()
  20. {
  21. return [];
  22. $result = $this->getClient()->classOfServices->getAllCos();
  23. foreach ($result as $item)
  24. {
  25. $cos = new CosModel($item);
  26. $tmp[$cos->getId()] = $cos;
  27. }
  28. return $tmp;
  29. }
  30. public function asArrayList()
  31. {
  32. $result = $this->getClient()->classOfServices->getAllCos();
  33. foreach ($result as $item)
  34. {
  35. $tmp[] = $item['NAME'];
  36. }
  37. return $tmp;
  38. }
  39. public function byName($name)
  40. {
  41. //todo add support
  42. }
  43. public function byId($id)
  44. {
  45. //todo add support
  46. }
  47. }