Download the PHP package plasticstudio/form-submission-cleanup without Composer
On this page you can find all versions of the php package plasticstudio/form-submission-cleanup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download plasticstudio/form-submission-cleanup
More information about plasticstudio/form-submission-cleanup
Files in plasticstudio/form-submission-cleanup
Package form-submission-cleanup
Short Description Configurable queued-job cleanup for SilverStripe form submission DataObjects.
License BSD-3-Clause
Informations about the package form-submission-cleanup
Form Submission Cleanup
A Silverstripe module that provides a single queued job to delete old form submission DataObjects on a daily schedule. Target classes, retention periods, and exclude rules are all defined in YAML config.
Requirements
- silverstripe/framework ^6
- symbiote/silverstripe-queuedjobs ^6.2
- silverstripe/userforms ^7 (optional — only required if targeting
SubmittedFormrecords)
Installation
Setup a cron job:
Configuration
Copy the relevant blocks into your project's _config/config.yml.
Globals
Targets
Add one entry per DataObject class to clean up. UserForms is shown as an example; omit it if the module is not installed.
Per-target options
| Key | Type | Description |
|---|---|---|
retention_days |
int | Overrides the global default for this class only |
date_field |
string | DataObject field to measure age against (default Created) |
exclude |
map | ORM filter passed to DataList::exclude() — matching records are kept |
Daily scheduling (default jobs)
Register the job as a QueuedJobs default job so it is automatically re-queued after each run.
Run a dev/build, then queue the first instance manually via the CMS (Admin > Jobs). Subsequent runs are scheduled automatically.
How it works
setup()iterates every configured target class, applies the retention cutoff and any exclude filter, and collects matching record IDs.process()deletes one record per step. Cascade-delete rules on each DataObject handle any related records (e.g.SubmittedFormFieldchildren onSubmittedForm).- After the job completes, the default jobs feature re-queues it for the next scheduled run.
All versions of form-submission-cleanup with dependencies
silverstripe/admin Version ^3
symbiote/silverstripe-queuedjobs Version ^6