2017-01-04 15:14:26 +03:00
|
|
|
<?php
|
|
|
|
|
2020-08-11 20:52:39 +03:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2017-01-04 15:14:26 +03:00
|
|
|
/**
|
|
|
|
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
|
|
|
*
|
|
|
|
* Mail
|
|
|
|
*
|
|
|
|
* This code is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3,
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3,
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OCA\Mail;
|
|
|
|
|
|
|
|
use Horde_Imap_Client_Mailbox;
|
|
|
|
|
2020-08-11 20:52:39 +03:00
|
|
|
class Folder {
|
2019-08-28 19:25:54 +03:00
|
|
|
/** @var int */
|
|
|
|
private $accountId;
|
2017-01-04 15:14:26 +03:00
|
|
|
|
|
|
|
/** @var Horde_Imap_Client_Mailbox */
|
|
|
|
private $mailbox;
|
|
|
|
|
|
|
|
/** @var array */
|
|
|
|
private $attributes;
|
|
|
|
|
|
|
|
/** @var string */
|
|
|
|
private $delimiter;
|
|
|
|
|
|
|
|
/** @var array */
|
|
|
|
private $status;
|
|
|
|
|
|
|
|
/** @var string[] */
|
|
|
|
private $specialUse;
|
|
|
|
|
2022-12-05 20:18:09 +03:00
|
|
|
private ?string $myAcls;
|
|
|
|
|
2023-05-04 09:29:51 +03:00
|
|
|
public function __construct(int $accountId,
|
|
|
|
Horde_Imap_Client_Mailbox $mailbox,
|
|
|
|
array $attributes,
|
|
|
|
?string $delimiter,
|
|
|
|
array $status) {
|
2019-08-28 19:25:54 +03:00
|
|
|
$this->accountId = $accountId;
|
2017-01-04 15:14:26 +03:00
|
|
|
$this->mailbox = $mailbox;
|
|
|
|
$this->attributes = $attributes;
|
|
|
|
$this->delimiter = $delimiter;
|
2023-05-04 09:29:51 +03:00
|
|
|
$this->status = $status;
|
2017-01-04 15:14:26 +03:00
|
|
|
$this->specialUse = [];
|
2022-12-05 20:18:09 +03:00
|
|
|
$this->myAcls = null;
|
2017-01-04 15:14:26 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getMailbox() {
|
|
|
|
return $this->mailbox->utf8;
|
|
|
|
}
|
|
|
|
|
2021-09-08 14:55:11 +03:00
|
|
|
public function getDelimiter(): ?string {
|
2017-01-04 15:14:26 +03:00
|
|
|
return $this->delimiter;
|
|
|
|
}
|
|
|
|
|
2020-08-11 20:52:39 +03:00
|
|
|
public function getAttributes(): array {
|
2017-01-04 15:14:26 +03:00
|
|
|
return $this->attributes;
|
|
|
|
}
|
|
|
|
|
2021-04-14 19:07:33 +03:00
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function getStatus(): array {
|
|
|
|
return $this->status;
|
|
|
|
}
|
|
|
|
|
2017-01-04 15:14:26 +03:00
|
|
|
/**
|
|
|
|
* @param array $status
|
2020-02-26 14:13:39 +03:00
|
|
|
*
|
|
|
|
* @return void
|
2017-01-04 15:14:26 +03:00
|
|
|
*/
|
2020-02-26 14:13:39 +03:00
|
|
|
public function setStatus(array $status): void {
|
2017-01-04 15:14:26 +03:00
|
|
|
$this->status = $status;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $use
|
2020-02-26 14:13:39 +03:00
|
|
|
*
|
|
|
|
* @return void
|
2017-01-04 15:14:26 +03:00
|
|
|
*/
|
2020-02-26 14:13:39 +03:00
|
|
|
public function addSpecialUse($use): void {
|
2017-01-04 15:14:26 +03:00
|
|
|
$this->specialUse[] = $use;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string[]
|
|
|
|
*/
|
|
|
|
public function getSpecialUse() {
|
|
|
|
return $this->specialUse;
|
|
|
|
}
|
2022-12-05 20:18:09 +03:00
|
|
|
|
|
|
|
public function setMyAcls(?string $acls) {
|
|
|
|
$this->myAcls = $acls;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getMyAcls(): ?string {
|
|
|
|
return $this->myAcls;
|
|
|
|
}
|
2017-01-04 15:14:26 +03:00
|
|
|
}
|