1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace OCP\Comments;
- use OCP\EventDispatcher\Event;
- class CommentsEntityEvent extends Event {
-
- public const EVENT_ENTITY = 'OCP\Comments\ICommentsManager::registerEntity';
-
- protected $collections;
-
- public function __construct() {
- parent::__construct();
- $this->collections = [];
- }
-
- public function addEntityCollection($name, \Closure $entityExistsFunction) {
- if (isset($this->collections[$name])) {
- throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"');
- }
- $this->collections[$name] = $entityExistsFunction;
- }
-
- public function getEntityCollections() {
- return $this->collections;
- }
- }
|