1<?php 2 3declare(strict_types=1); 4 5/** 6 * @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com> 7 * 8 * @author John Molakvoæ <skjnldsv@protonmail.com> 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 */ 26 27namespace OCA\Files_Sharing\Event; 28 29use OCP\EventDispatcher\Event; 30use OCP\Share\IShare; 31 32class ShareLinkAccessedEvent extends Event { 33 /** @var IShare */ 34 private $share; 35 36 /** @var string */ 37 private $step; 38 39 /** @var int */ 40 private $errorCode; 41 42 /** @var string */ 43 private $errorMessage; 44 45 public function __construct(IShare $share, string $step = '', int $errorCode = 200, string $errorMessage = '') { 46 parent::__construct(); 47 $this->share = $share; 48 $this->step = $step; 49 $this->errorCode = $errorCode; 50 $this->errorMessage = $errorMessage; 51 } 52 53 public function getShare(): IShare { 54 return $this->share; 55 } 56 57 public function getStep(): string { 58 return $this->step; 59 } 60 61 public function getErrorCode(): int { 62 return $this->errorCode; 63 } 64 65 public function getErrorMessage(): string { 66 return $this->errorMessage; 67 } 68} 69