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.

MapperEvent.php 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  7. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  8. * @author Joas Schilling <coding@schilljs.com>
  9. * @author Roeland Jago Douma <roeland@famdouma.nl>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  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, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCP\SystemTag;
  27. use OCP\EventDispatcher\Event;
  28. /**
  29. * Class MapperEvent
  30. *
  31. * @since 9.0.0
  32. */
  33. class MapperEvent extends Event {
  34. /**
  35. * @deprecated 22.0.0
  36. */
  37. public const EVENT_ASSIGN = 'OCP\SystemTag\ISystemTagObjectMapper::assignTags';
  38. /**
  39. * @deprecated 22.0.0
  40. */
  41. public const EVENT_UNASSIGN = 'OCP\SystemTag\ISystemTagObjectMapper::unassignTags';
  42. /** @var string */
  43. protected $event;
  44. /** @var string */
  45. protected $objectType;
  46. /** @var string */
  47. protected $objectId;
  48. /** @var int[] */
  49. protected $tags;
  50. /**
  51. * DispatcherEvent constructor.
  52. *
  53. * @param string $event
  54. * @param string $objectType
  55. * @param string $objectId
  56. * @param int[] $tags
  57. * @since 9.0.0
  58. */
  59. public function __construct(string $event, string $objectType, string $objectId, array $tags) {
  60. $this->event = $event;
  61. $this->objectType = $objectType;
  62. $this->objectId = $objectId;
  63. $this->tags = $tags;
  64. }
  65. /**
  66. * @return string
  67. * @since 9.0.0
  68. */
  69. public function getEvent(): string {
  70. return $this->event;
  71. }
  72. /**
  73. * @return string
  74. * @since 9.0.0
  75. */
  76. public function getObjectType(): string {
  77. return $this->objectType;
  78. }
  79. /**
  80. * @return string
  81. * @since 9.0.0
  82. */
  83. public function getObjectId(): string {
  84. return $this->objectId;
  85. }
  86. /**
  87. * @return int[]
  88. * @since 9.0.0
  89. */
  90. public function getTags(): array {
  91. return $this->tags;
  92. }
  93. }