Skip to content

Commit

Permalink
chore: support gdpr beta 17 (#92)
Browse files Browse the repository at this point in the history
* chore: support gdpr beta 17

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <[email protected]>
  • Loading branch information
imorland and StyleCIBot authored Oct 25, 2023
1 parent db5eb55 commit fdb2a8f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Data/Drafts.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

class Drafts extends Type
{
public static function exportDescription(): string
{
return 'All drafts created by the user.';
}

public function export(ZipFile $zip): void
{
Draft::query()
Expand All @@ -37,12 +42,22 @@ protected function sanitize(Draft $draft): array
]);
}

public static function anonymizeDescription(): string
{
return self::deleteDescription();
}

public function anonymize(): void
{
// In the case of drafts, it makes no sense to keep them after a user is anonymized.
$this->delete();
}

public static function deleteDescription(): string
{
return 'Delete all drafts created by the user.';
}

public function delete(): void
{
Draft::query()
Expand Down

0 comments on commit fdb2a8f

Please sign in to comment.