Account.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Models;
  3. use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Interfaces\AbstractModel;
  4. /**
  5. *
  6. * Created by PhpStorm.
  7. * User: ThurData
  8. * Date: 10.09.19
  9. * Time: 08:43
  10. * Class Account
  11. */
  12. class Account extends AbstractModel
  13. {
  14. /**
  15. * Account Attributes
  16. */
  17. const ATTR_FIRSTNAME = 'givenName';
  18. const ATTR_LASTNAME = 'sn';
  19. const ATTR_PHONE = 'telephoneNumber';
  20. const ATTR_MOBILE_PHONE = 'mobile';
  21. const ATTR_FAX = 'facsimileTelephoneNumber';
  22. const ATTR_PAGER = 'pager';
  23. const ATTR_HOME_PHONE = 'homePhone';
  24. const ATTR_COUNTRY = 'co';
  25. const ATTR_STATE = 'st';
  26. const ATTR_POSTAL_CODE = 'postalCode';
  27. const ATTR_CITY = 'l';
  28. const ATTR_STREET = 'street';
  29. const ATTR_COMPANY = 'company';
  30. const ATTR_PROF_TITLE = 'title';
  31. const ATTR_ACCOUNT_STATUS = 'kerioAccountStatus';
  32. const ATTR_DISPLAY_NAME = 'displayName';
  33. const ATTR_MAIL_QUOTA = 'kerioMailQuota';
  34. const ATTR_ALIAS = 'kerioMailAlias';
  35. const ATTR_CLASS_OF_SERVICE_ID = 'kerioCOSId';
  36. protected $id;
  37. protected $name;
  38. protected $password;
  39. protected $attrs;
  40. protected $limit;
  41. protected $used;
  42. /**
  43. * @return mixed
  44. */
  45. public function getName()
  46. {
  47. return $this->name;
  48. }
  49. /**
  50. * @param $name
  51. * @return $this
  52. */
  53. public function setName($name)
  54. {
  55. $this->name = $name;
  56. return $this;
  57. }
  58. /**
  59. * @return mixed
  60. */
  61. public function getPassword()
  62. {
  63. return $this->password;
  64. }
  65. /**
  66. * @param $password
  67. * @return $this
  68. */
  69. public function setPassword($password)
  70. {
  71. $this->password = $password;
  72. return $this;
  73. }
  74. /**
  75. * @return mixed
  76. */
  77. public function getId()
  78. {
  79. return $this->id;
  80. }
  81. /**
  82. * @param $id
  83. * @return $this
  84. */
  85. public function setId($id)
  86. {
  87. $this->id = $id;
  88. return $this;
  89. }
  90. /**
  91. * @return mixed
  92. */
  93. public function getLimit()
  94. {
  95. return $this->limit;
  96. }
  97. /**
  98. * @param $limit
  99. * @return $this
  100. */
  101. public function setLimit($limit = 0)
  102. {
  103. $this->limit = $limit;
  104. return $this;
  105. }
  106. /**
  107. * @return mixed
  108. */
  109. public function getUsed()
  110. {
  111. return $this->used;
  112. }
  113. /**
  114. * @param $used
  115. * @return $this
  116. */
  117. public function setUsed($used = 0)
  118. {
  119. $this->used = $used;
  120. return $this;
  121. }
  122. /**
  123. * @return mixed
  124. */
  125. public function getAttrs()
  126. {
  127. return $this->attrs;
  128. }
  129. /**
  130. * @param $key
  131. * @param null $value
  132. * @return $this
  133. */
  134. public function setAttr($key, $value = null)
  135. {
  136. $this->attrs[$key] = $value;
  137. return $this;
  138. }
  139. /**
  140. * @param $key
  141. * @return mixed
  142. */
  143. public function getAttr($key)
  144. {
  145. return $this->attrs[$key];
  146. }
  147. /**
  148. * @param $attrs
  149. * @return $this
  150. */
  151. public function setAttrs($attrs = [])
  152. {
  153. $this->attrs = $attrs;
  154. return $this;
  155. }
  156. /**
  157. * @return mixed
  158. */
  159. public function getCosId()
  160. {
  161. return $this->getDataResourceA(self::ATTR_CLASS_OF_SERVICE_ID);
  162. }
  163. /**
  164. * @return mixed
  165. */
  166. public function getAliases()
  167. {
  168. foreach($this->resources['a'] as $res)
  169. {
  170. if($res['N'] === self::ATTR_ALIAS)
  171. {
  172. $tmp[$res['DATA']] = $res['DATA'];
  173. }
  174. }
  175. return $tmp;
  176. }
  177. }