AccountAnonymizationManager
in package
implements
AccountAnonymizationStepInterface
FinalYes
Base share of anonymizing a deleted account: - comments and reviews stay, but the author name copied into them at posting time is replaced by "Deleted user" and the copied e-mail is cleared (templates print the copy directly; the reviewer e-mail `user_email` of a review is not mapped by the entity — raw UPDATE), - the newsletter address of the account e-mail is deleted (unsubscribed; it has no user FK, the e-mail is the only link — hence it runs before the account e-mail is overwritten).
Table of Contents
Interfaces
- AccountAnonymizationStepInterface
- One module's share of anonymizing a deleted account.
Properties
- $commentManager : CommentManager
- $newsletterAddressManager : NewsletterAddressManager
- $ratingManager : RatingManager
Methods
- __construct() : mixed
- anonymizeUser() : array<string, int>
- assertSuccess() : void
- findIds() : array<int, int>
Properties
$commentManager read-only
private
CommentManager
$commentManager
$newsletterAddressManager read-only
private
NewsletterAddressManager
$newsletterAddressManager
$ratingManager read-only
private
RatingManager
$ratingManager
Methods
__construct()
public
__construct(CommentManager $commentManager, RatingManager $ratingManager, NewsletterAddressManager $newsletterAddressManager) : mixed
Parameters
- $commentManager : CommentManager
- $ratingManager : RatingManager
- $newsletterAddressManager : NewsletterAddressManager
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
findIds()
private
findIds(array<string|int, mixed> $entities) : array<int, int>
Parameters
- $entities : array<string|int, mixed>