-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IBX-1310: Created slots for assigning/unassigning user to groups (#3125)
- Loading branch information
Showing
3 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
eZ/Publish/Core/Search/Common/Slot/AssignUserToUserGroup.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace eZ\Publish\Core\Search\Common\Slot; | ||
|
||
use eZ\Publish\Core\SignalSlot\Signal; | ||
|
||
/** | ||
* A Search Engine slot handling AssignUserToUserGroupSignal. | ||
*/ | ||
final class AssignUserToUserGroup extends AbstractSubtree | ||
{ | ||
public function receive(Signal $signal): void | ||
{ | ||
if (!$signal instanceof Signal\UserService\AssignUserToUserGroupSignal) { | ||
return; | ||
} | ||
|
||
$content = $this->persistenceHandler->contentHandler()->load($signal->userId); | ||
$this->searchHandler->indexContent($content); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
eZ/Publish/Core/Search/Common/Slot/UnAssignUserFromUserGroup.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace eZ\Publish\Core\Search\Common\Slot; | ||
|
||
use eZ\Publish\Core\SignalSlot\Signal; | ||
use eZ\Publish\Core\Search\Common\Slot; | ||
|
||
/** | ||
* A Search Engine slot handling UnAssignUserFromUserGroup. | ||
*/ | ||
final class UnAssignUserFromUserGroup extends Slot | ||
{ | ||
public function receive(Signal $signal): void | ||
{ | ||
if (!$signal instanceof Signal\UserService\UnAssignUserFromUserGroupSignal) { | ||
return; | ||
} | ||
|
||
$content = $this->persistenceHandler->contentHandler()->load($signal->userId); | ||
$this->searchHandler->indexContent($content); | ||
} | ||
} |