ClassOfServices.php 1.3 KB

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