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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. /**
  3. * @author Joas Schilling <nickvergessen@owncloud.com>
  4. *
  5. * @copyright Copyright (c) 2016, ownCloud, Inc.
  6. * @license AGPL-3.0
  7. *
  8. * This code is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License, version 3,
  10. * as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License, version 3,
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>
  19. *
  20. */
  21. namespace OCP\SystemTag;
  22. use Symfony\Component\EventDispatcher\Event;
  23. /**
  24. * Class MapperEvent
  25. *
  26. * @package OCP\SystemTag
  27. * @since 9.0.0
  28. */
  29. class MapperEvent extends Event {
  30. const EVENT_ASSIGN = 'OCP\SystemTag\ISystemTagObjectMapper::assignTags';
  31. const EVENT_UNASSIGN = 'OCP\SystemTag\ISystemTagObjectMapper::unassignTags';
  32. /** @var string */
  33. protected $event;
  34. /** @var string */
  35. protected $objectType;
  36. /** @var string */
  37. protected $objectId;
  38. /** @var int[] */
  39. protected $tags;
  40. /**
  41. * DispatcherEvent constructor.
  42. *
  43. * @param string $event
  44. * @param string $objectType
  45. * @param string $objectId
  46. * @param int[] $tags
  47. * @since 9.0.0
  48. */
  49. public function __construct($event, $objectType, $objectId, array $tags) {
  50. $this->event = $event;
  51. $this->objectType = $objectType;
  52. $this->objectId = $objectId;
  53. $this->tags = $tags;
  54. }
  55. /**
  56. * @return string
  57. * @since 9.0.0
  58. */
  59. public function getEvent() {
  60. return $this->event;
  61. }
  62. /**
  63. * @return string
  64. * @since 9.0.0
  65. */
  66. public function getObjectType() {
  67. return $this->objectType;
  68. }
  69. /**
  70. * @return string
  71. * @since 9.0.0
  72. */
  73. public function getObjectId() {
  74. return $this->objectId;
  75. }
  76. /**
  77. * @return int[]
  78. * @since 9.0.0
  79. */
  80. public function getTags() {
  81. return $this->tags;
  82. }
  83. }