generated from Nodarx/template
40 lines
1.0 KiB
PHP
40 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace KTXM\ProviderImapMail\Service\Remote\Command;
|
|
|
|
use Gricob\IMAP\Protocol\Command\Command;
|
|
use Gricob\IMAP\Protocol\Command\Argument\SequenceSet;
|
|
use Gricob\IMAP\Protocol\Command\Argument\Store\Flags;
|
|
|
|
/**
|
|
* Bulk UID STORE command for flag mutations.
|
|
*
|
|
* A thin ergonomic wrapper around gricob's FetchCommand that accepts an array
|
|
* of UIDs and a pre-built Flags argument so callers don't have to construct
|
|
* SequenceSet directly.
|
|
*
|
|
* Example: UID STORE 1,3,7 +FLAGS.SILENT (\Seen)
|
|
*/
|
|
final readonly class StoreCommand extends Command
|
|
{
|
|
/**
|
|
* @param int[] $uids UIDs to operate on
|
|
* @param Flags $flags e.g. new Flags(['\Seen'], '+')
|
|
*/
|
|
public function __construct(array $uids, Flags $flags)
|
|
{
|
|
parent::__construct(
|
|
'UID STORE',
|
|
new SequenceSet(...$uids),
|
|
$flags,
|
|
);
|
|
}
|
|
}
|