AccountAnonymizationManager
in package
implements
AccountAnonymizationStepInterface
FinalYes
Comcat step of anonymizing a deleted account.
The user's company profiles are deactivated (not deleted), reindexed and the category counts are recounted. Watchdogs are deleted, otherwise they would keep e-mailing the original address.
NOTE: the contact data of a company profile (e-mail, phone, street) are not scrubbed. They are the company's business contact, not the account's personal data, and the profile is hidden anyway. Bazaar adverts are scrubbed (see the Bazaar step).
Table of Contents
Interfaces
- AccountAnonymizationStepInterface
- One module's share of anonymizing a deleted account.
Properties
- $advertManager : AdvertManager
- $categoryManager : CategoryManager
- $esDocumentSource : AdvertDocumentSource
- $esIndexer : EsEntityIndexer
- $watchdogManager : WatchdogManager
Methods
- __construct() : mixed
- anonymizeUser() : array<string, int>
- assertSuccess() : void
- findActiveAdvertIds() : array<int, int>
Properties
$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, CategoryManager $categoryManager, EsEntityIndexer $esIndexer, AdvertDocumentSource $esDocumentSource) : mixed
Parameters
- $advertManager : AdvertManager
- $watchdogManager : WatchdogManager
- $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
findActiveAdvertIds()
private
findActiveAdvertIds(int $userId) : array<int, int>
Parameters
- $userId : int