1<?php 2 3declare(strict_types=1); 4 5/** 6 * @copyright 2020 Christoph Wurst <christoph@winzerhof-wurst.at> 7 * 8 * @author 2020 Christoph Wurst <christoph@winzerhof-wurst.at> 9 * 10 * @license GNU AGPL version 3 or any later version 11 * 12 * This program is free software: you can redistribute it and/or modify 13 * it under the terms of the GNU Affero General Public License as 14 * published by the Free Software Foundation, either version 3 of the 15 * License, or (at your option) any later version. 16 * 17 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU Affero General Public License for more details. 21 * 22 * You should have received a copy of the GNU Affero General Public License 23 * along with this program. If not, see <http://www.gnu.org/licenses/>. 24 */ 25 26namespace OCA\Mail\Events; 27 28use OCA\Mail\Account; 29use OCA\Mail\Db\Mailbox; 30use OCA\Mail\Db\Message; 31use OCP\EventDispatcher\Event; 32 33class NewMessagesSynchronized extends Event { 34 35 /** @var Account */ 36 private $account; 37 38 /** @var Mailbox */ 39 private $mailbox; 40 41 /** @var array|Message[] */ 42 private $messages; 43 44 /** 45 * @param Account $account 46 * @param Mailbox $mailbox 47 * @param Message[] $messages 48 */ 49 public function __construct(Account $account, 50 Mailbox $mailbox, 51 array $messages) { 52 parent::__construct(); 53 $this->account = $account; 54 $this->mailbox = $mailbox; 55 $this->messages = $messages; 56 } 57 58 public function getAccount(): Account { 59 return $this->account; 60 } 61 62 public function getMailbox(): Mailbox { 63 return $this->mailbox; 64 } 65 66 /** 67 * @return Message[] 68 */ 69 public function getMessages() { 70 return $this->messages; 71 } 72} 73