You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.8 KiB

  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2019 Joas Schilling <coding@schilljs.com>
  5. *
  6. * @license GNU AGPL version 3 or any later version
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License as
  10. * published by the Free Software Foundation, either version 3 of the
  11. * License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. namespace OCA\Talk\Events;
  23. use OCA\Talk\Participant;
  24. use OCA\Talk\Room;
  25. class ModifyRoomEvent extends RoomEvent {
  26. /** @var string */
  27. protected $parameter;
  28. /** @var int|string|bool */
  29. protected $newValue;
  30. /** @var int|string|bool|null */
  31. protected $oldValue;
  32. /** @var Participant|null */
  33. protected $actor;
  34. public function __construct(Room $room,
  35. string $parameter,
  36. $newValue,
  37. $oldValue = null,
  38. ?Participant $actor = null) {
  39. parent::__construct($room);
  40. $this->parameter = $parameter;
  41. $this->newValue = $newValue;
  42. $this->oldValue = $oldValue;
  43. $this->actor = $actor;
  44. }
  45. public function getParameter(): string {
  46. return $this->parameter;
  47. }
  48. /**
  49. * @return int|string|bool
  50. */
  51. public function getNewValue() {
  52. return $this->newValue;
  53. }
  54. /**
  55. * @return int|string|bool|null
  56. */
  57. public function getOldValue() {
  58. return $this->oldValue;
  59. }
  60. public function getActor(): ?Participant {
  61. return $this->actor;
  62. }
  63. }