Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

MapperEvent.php 2.1KB

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