1 | <?php |
||
20 | class Mailbox extends MailObject |
||
21 | { |
||
22 | const CACHE_DATA = 'mailbox'; |
||
23 | |||
24 | /** |
||
25 | * Construct the object. |
||
26 | * |
||
27 | * @param string $prefix The part before the @ in the address |
||
28 | * @param Domain $domain The containing domain |
||
29 | * @param string|array|null $config URL encoded config string as returned by CMD_API_POP |
||
30 | */ |
||
31 | public function __construct($prefix, Domain $domain, $config = null) |
||
38 | |||
39 | /** |
||
40 | * Creates a new mailbox. |
||
41 | * |
||
42 | * @param Domain $domain Domain to add the account to |
||
43 | * @param string $prefix Prefix for the account |
||
44 | * @param string $password Password for the account |
||
45 | * @param int|null $quota Quota in megabytes, or zero/null for unlimited |
||
46 | * @param int|null $sendLimit Send limit, or 0 for unlimited, or null for system default |
||
47 | * @return Mailbox The created mailbox |
||
48 | */ |
||
49 | public static function create(Domain $domain, $prefix, $password, $quota = null, $sendLimit = null) |
||
60 | |||
61 | /** |
||
62 | * Deletes the mailbox. |
||
63 | */ |
||
64 | public function delete() |
||
68 | |||
69 | /** |
||
70 | * Reset the password for this mailbox. |
||
71 | * |
||
72 | * @param string $newPassword |
||
73 | */ |
||
74 | public function setPassword($newPassword) |
||
82 | |||
83 | /** |
||
84 | * Returns the disk quota in megabytes. |
||
85 | * |
||
86 | * @return float|null |
||
87 | */ |
||
88 | public function getDiskLimit() |
||
92 | |||
93 | /** |
||
94 | * Returns the disk usage in megabytes. |
||
95 | * |
||
96 | * @return float |
||
97 | */ |
||
98 | public function getDiskUsage() |
||
102 | |||
103 | /** |
||
104 | * Return the amount of mails sent in the current period. |
||
105 | * |
||
106 | * @return int |
||
107 | */ |
||
108 | public function getMailsSent() |
||
112 | |||
113 | /** |
||
114 | * Return the maximum number of mails that can be send each day |
||
115 | * |
||
116 | * @return int |
||
117 | */ |
||
118 | public function getMailLimit() |
||
122 | |||
123 | /** |
||
124 | * Returns if the mailbox is suspended or not |
||
125 | * |
||
126 | * @return bool |
||
127 | */ |
||
128 | public function getMailSuspended() |
||
132 | |||
133 | |||
134 | /** |
||
135 | * Cache wrapper to keep mailbox stats up to date. |
||
136 | * |
||
137 | * @param string $key |
||
138 | * @return mixed |
||
139 | */ |
||
140 | protected function getData($key) |
||
151 | } |
||
152 |