PHPackages                             punktde/form-persistence - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. punktde/form-persistence

ActiveNeos-package[Database &amp; ORM](/categories/database)

punktde/form-persistence
========================

Provides a form finisher to save the form data to the database and a backend module to download the data.

3.3.1(10mo ago)722.0k↓25%7[5 PRs](https://github.com/punktDe/form-persistence/pulls)MITPHPCI failing

Since Jun 10Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/punktDe/form-persistence)[ Packagist](https://packagist.org/packages/punktde/form-persistence)[ Docs](https://github.com/punktDe/form-persistence)[ RSS](/packages/punktde-form-persistence/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (37)Used By (0)

PunktDe.Form.Persistence
========================

[](#punktdeformpersistence)

[![Latest Stable Version](https://camo.githubusercontent.com/6f4fbc4c81a31ee4b5bb1c9f7b94d257de853fb3b7b709a16062f0af3691936d/68747470733a2f2f706f7365722e707567782e6f72672f70756e6b7444652f666f726d2d70657273697374656e63652f762f737461626c65)](https://packagist.org/packages/punktDe/form-persistence) [![Total Downloads](https://camo.githubusercontent.com/08660ca4861e62c87c9ffbc55623cfbb643dc4b5e7c6a520365f3efee3ba8c48/68747470733a2f2f706f7365722e707567782e6f72672f70756e6b7444652f666f726d2d70657273697374656e63652f646f776e6c6f616473)](https://packagist.org/packages/punktDe/form-persistence) [![License](https://camo.githubusercontent.com/efdfa720240f2ff56fdb25dfc235a149049e3e2288992c5753e2d0c3ec59b13c/68747470733a2f2f706f7365722e707567782e6f72672f70756e6b7444652f666f726d2d70657273697374656e63652f6c6963656e7365)](https://packagist.org/packages/punktDe/form-persistence)

Features
--------

[](#features)

- **Persistence finisher** to persist form data into your database.
- It further provides a **backend module to download** the data in different formats.
- An **export definition editor** lets you define your custom export definitions.
- Data can be sent in **aggregated via email** regularly
- A **retention policy** can be configured to respect data privacy policies
- **Access to data can be restricted** by sites or content dimension
- Form data is aggregated by the combination of the form identifier and a hash of the form field identifiers to **avoid conflicts when forms change**.

[![Backend Module](Documentation/BackendModule.png)](Documentation/BackendModule.png)

Installation
============

[](#installation)

```
composer require punktde/form-persistence
```

After the successful installation run `./flow doctrine:migrate` to initialize the database table.

Configuration
=============

[](#configuration)

Exclude form types from saving
------------------------------

[](#exclude-form-types-from-saving)

Some form types are only for structuring the form or to display static text and should not be available for export. These form types can now be excluded using extendable configuration:

```
PunktDe:
  Form:
    Persistence:
      finisher:
        excludedFormTypes:
          'Neos.Form:StaticText': true
```

Export Definitions
------------------

[](#export-definitions)

Static export definitions can be defined via settings.

**fileNamePattern**:

Example: `Form-Export-{formIdentifier}-{currentDate}.csv`

The following variables ca be used:

- formIdentifier
- formVersionHash
- currentDate
- exportDefinitionIdentifier

Processor Chain
---------------

[](#processor-chain)

Processing steps for processing the form data are defined in the `processorChain` configuration. This chain is currently used globally for all exports. You can add your own processors using the postionalArraySprtingSyntax for their positionin the chain.

Example:

```
PunktDe:
  Form:
    Persistence:
      processorChain:
        # My processor
        myProcessor:
          class: 'Vendor\FormProcessors\MyProcessor'
          position: end
```

Privileges
----------

[](#privileges)

Form data may contain sensitive data. The package thus offers priviliges to give backend users individual access.

### Site Privilege

[](#site-privilege)

In a multi-site environment you can restrict the accessibility to form data depending on the site using the `PunktDe\Form\Persistence\Authorization\Privilege\SitePrivilege`. In a `Policy.yaml` add

```
'PunktDe\Form\Persistence\Authorization\Privilege\SitePrivilege':
  'PunktDe.Form.Persistence:Sites.All':
    label: Access to form data of all sites
    matcher: '*'

'PunktDe.Form.Persistence:Sites.MyFirstSite':
  label: Access to form data of site my-site
  matcher: 'my-site'
```

The matcher accepts, '\*', a single name or a comma-separated list of site names.

### Dimension Privilege

[](#dimension-privilege)

In a multi-dimension environment you can restrict the accessibility to form data depending on the content dimension combination using the `PunktDe\Form\Persistence\Authorization\Privilege\SitePrivilege`. In a `Policy.yaml` add

```
'PunktDe\Form\Persistence\Authorization\Privilege\ContentDimensionPrivilege':
  'PunktDe.Form.Persistence:Dimensions.All':
    label: Access to form data of all content dimensions
    matcher: '*'

'PunktDe.Form.Persistence:Dimensions.Germany':
  label: Access to form data of all langues in the german country
  matcher: '{"country": ["deu"]}'
```

The matcher accepts, '\*', or a json definition of the dimensions. See `ContentDimensionPrivilegeTargetTest.php` for details.

Usage
=====

[](#usage)

Add the SaveFormDataFinisher
----------------------------

[](#add-the-saveformdatafinisher)

### Using the flow form configuration

[](#using-the-flow-form-configuration)

```
type: 'Neos.Form:Form'
identifier: 'my-form'
renderables:
    ...

finishers:
  saveFormData:
    identifier: 'PunktDe.Form.Persistence:SaveFormDataFinisher'
```

### Using the Neos Form Builder

[](#using-the-neos-form-builder)

Require the suggested package neos/form-builder and add the save form data finisher to your node based form in the neos backend.

Scheduled Exports
-----------------

[](#scheduled-exports)

Exports of your form data can be sent to a specific eMail Address on a regular basis. eMail address and export definition can be configured directly at the finisher. To trigger the export, the command `formPersistence:sendExport` needs to be called.

Backend Module
--------------

[](#backend-module)

### Download form data

[](#download-form-data)

A simple backend module is provided to download the form data as multiple formats like CSV,Excel and Html here`s a list of possible formats . The form version specifies the used fields and their position. With that it is taken care, that if the form changes over time, a separate CSV or Excel file with consistent headers and column position is generated.

[![Backend Module](Documentation/BackendModule.png)](Documentation/BackendModule.png)

### Define Export Definitions

[](#define-export-definitions)

The package brings a graphical editor for defining export definitions. With an export definition you can define the fields together whith the field names which are added to the export.

[![Backend Module](Documentation/ExportDefinitionEditor.png)](Documentation/ExportDefinitionEditor.png)

Clean up old form data
----------------------

[](#clean-up-old-form-data)

To clean up old form data entries manually or on a regular basis, one needs to configure the retention period and call the command `formpersistence:cleanupformdata`. In the following example a retention period of 30 days is configured and therefore every form data entry older than 30 days ist deleted upon calling the command.

```
PunktDe:
  Form:
    Persistence:
      formDataCleanup:
        retentionPeriod: 'P30D'
```

The whole functionality is encapsulated in a service to allow a better integration into different approaches for regular execution of this functionality for example with a scheduler or queuing work flow.

Developing the package
======================

[](#developing-the-package)

Export Definition Editor
------------------------

[](#export-definition-editor)

### Working with the react app

[](#working-with-the-react-app)

To start make changes to the export definition app go to the folder `PunktDe.Form.Persistence/Resources/Public/ExportDefinitionEditorApp`and run the command

```
yarn install
```

After all dependencies are installed, you can adjust the code of the react app. The is created with the help of creat-react-app scaffolding tool and therefore uses its build configuration with some adjustments. To see changes, you need to build the app with the following command.

```
yarn build
```

The generated file `main.js` is located in the folder `build/static/js`. This file is loaded in the Neos Backend and is the editor you see.

Run tests with PHPStan
----------------------

[](#run-tests-with-phpstan)

**Analyse the full project:**

```
vendor/bin/phpstan analyse -c phpstan.neon
```

**Analyse a specific file:**

```
vendor/bin/phpstan analyse Classes/Path/To/File.php
```

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance73

Regular maintenance activity

Popularity34

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 62.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~66 days

Recently: every ~102 days

Total

31

Last Release

167d ago

Major Versions

1.0.1 → 2.0.02021-06-01

2.6.3 → 3.0.02022-05-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fad3b9ab04057e586b701aca7a8dbbf9598718114cdfd6bf85dada030f7688e?d=identicon)[punktde](/maintainers/punktde)

---

Top Contributors

[![daniellienert](https://avatars.githubusercontent.com/u/642226?v=4)](https://github.com/daniellienert "daniellienert (111 commits)")[![andrehoffmann30](https://avatars.githubusercontent.com/u/23524251?v=4)](https://github.com/andrehoffmann30 "andrehoffmann30 (45 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 commits)")[![LeCreator](https://avatars.githubusercontent.com/u/79138277?v=4)](https://github.com/LeCreator "LeCreator (5 commits)")[![paavo](https://avatars.githubusercontent.com/u/1118783?v=4)](https://github.com/paavo "paavo (3 commits)")[![kdambekalns](https://avatars.githubusercontent.com/u/95873?v=4)](https://github.com/kdambekalns "kdambekalns (1 commits)")

---

Tags

formhacktoberfestneoscms

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/punktde-form-persistence/health.svg)

```
[![Health](https://phpackages.com/badges/punktde-form-persistence/health.svg)](https://phpackages.com/packages/punktde-form-persistence)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[usmanhalalit/laracsv

A Laravel package to easily generate CSV files from Eloquent model.

6151.7M4](/packages/usmanhalalit-laracsv)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[forkcms/forkcms

Fork is an open source CMS that will rock your world.

1.2k44.5k](/packages/forkcms-forkcms)[neos/form-builder

Flow Form Framework integration into Neos CMS

19347.1k18](/packages/neos-form-builder)[pimcore/studio-backend-bundle

Pimcore Studio Backend Bundle

19112.5k3](/packages/pimcore-studio-backend-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
