AccountAnonymizationManager
in package
implements
AccountAnonymizationStepInterface
Bazaar share of anonymizing a deleted account: - the user's adverts are deactivated (not deleted — the owner of a deleted account cannot restore them, but the administration still sees them), reindexed and the category counts recounted, - the contact data of all the user's own adverts (any state) are deleted: `email` → '' and the values of the contact parameters (e-mail, phone, street — see {@see \App\Core\Base\Shared\Shared\Models\Entities\ContactParameter}); the fulltext document carries no contact, so no reindex for it, - watchdogs (they would keep e-mailing the original address) and followed adverts are deleted.
Table of Contents
Interfaces
- AccountAnonymizationStepInterface
- One module's share of anonymizing a deleted account.
Properties
- $advertFollowerManager : AdvertFollowerManager
- $advertManager : AdvertManager
- $categoryManager : CategoryManager
- $esDocumentSource : AdvertDocumentSource
- $esIndexer : EsEntityIndexer
- $watchdogManager : WatchdogManager
Methods
- __construct() : mixed
- anonymizeUser() : array<string, int>
- assertSuccess() : void
- deletedCount() : int
- findActiveAdvertIds() : array<int, int>
Properties
$advertFollowerManager read-only
private
AdvertFollowerManager
$advertFollowerManager
$advertManager read-only
private
AdvertManager
$advertManager
$categoryManager read-only
private
CategoryManager
$categoryManager
$esDocumentSource read-only
private
AdvertDocumentSource
$esDocumentSource
$esIndexer read-only
private
EsEntityIndexer
$esIndexer
$watchdogManager read-only
private
WatchdogManager
$watchdogManager
Methods
__construct()
public
__construct(AdvertManager $advertManager, WatchdogManager $watchdogManager, AdvertFollowerManager $advertFollowerManager, CategoryManager $categoryManager, EsEntityIndexer $esIndexer, AdvertDocumentSource $esDocumentSource) : mixed
Parameters
- $advertManager : AdvertManager
- $watchdogManager : WatchdogManager
- $advertFollowerManager : AdvertFollowerManager
- $categoryManager : CategoryManager
- $esIndexer : EsEntityIndexer
- $esDocumentSource : AdvertDocumentSource
anonymizeUser()
public
anonymizeUser(int $userId, string $originalEmail, string $deletedLabel) : array<string, int>
Parameters
- $userId : int
- $originalEmail : string
-
e-mail of the account before anonymization ('' = none)
- $deletedLabel : string
-
translated "Deleted user" written over copied author names
Return values
array<string, int> —what was changed, for the audit log (e.g. bazaarAdvertsDeactivated => 2)
assertSuccess()
private
assertSuccess(Result $result, string $step) : void
Parameters
- $result : Result
- $step : string
deletedCount()
private
deletedCount(Result $result) : int
Parameters
- $result : Result
Return values
intfindActiveAdvertIds()
private
findActiveAdvertIds(int $userId) : array<int, int>
Parameters
- $userId : int