SubmissionTrashService
Corex\Config\Submissions\SubmissionTrashService · class · Config layer
Moves submissions to the trash and back, and deletes them for good from it (spec 105, US1 and US2). It is the only thing that does. Each action is checked against what the person may see, written into every submission’s own history while it has one, and recorded once in the activity stream: who, when, how many. Nothing a visitor submitted is put in that record.
Public API
Section titled “Public API”__construct(SubmissionWorkflowStore $submissions, SubmissionTrashStore $trash, SubmissionTimelineStore $timeline, ActivityService $activity, SubmissionEmailRecords $emails)
Section titled “__construct(SubmissionWorkflowStore $submissions, SubmissionTrashStore $trash, SubmissionTimelineStore $timeline, ActivityService $activity, SubmissionEmailRecords $emails)”trash(SubmissionAccessScope $scope, array $versions, string $via): void
Section titled “trash(SubmissionAccessScope $scope, array $versions, string $via): void”trashForRetention(SubmissionAccessScope $scope, array $ids): int
Section titled “trashForRetention(SubmissionAccessScope $scope, array $ids): int”The retention panel’s “Move to trash”: what is due, and this person’s to act on. One that is not theirs is left where it is and the rest are moved. A selection in the inbox is refused as a whole for that, because the person chose those rows; here they chose “everything that is due”, and nothing was shown to them that could have changed since.
restore(SubmissionAccessScope $scope, array $ids): void
Section titled “restore(SubmissionAccessScope $scope, array $ids): void”delete(SubmissionAccessScope $scope, array $ids): array
Section titled “delete(SubmissionAccessScope $scope, array $ids): array”Delete trashed submissions for good: each one’s uploaded files, then the copies of its emails, then the submission and everything stored on it (FR-011). One that cannot be deleted does not stop the others (FR-015). A submission whose file could not be removed is left in the trash: deleting it would lose the only record of where that file is (FR-016).
expire(array $ids): int
Section titled “expire(array $ids): int”Delete trashed submissions because the trash kept them as long as it keeps anything (FR-017). The same removal as a person’s, recorded as the trash’s own.
forgetTiedData(int $id): bool
Section titled “forgetTiedData(int $id): bool”Remove what is tied to a submission and stored apart from it: its uploaded files, and the copies of its emails. For a submission that something else is deleting (FR-020).
trashed(SubmissionAccessScope $scope, int $id): ?array
Section titled “trashed(SubmissionAccessScope $scope, int $id): ?array”A trashed submission this person may see, or null.