PHPackages                             heimrichhannot/contao-versions - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. heimrichhannot/contao-versions

ActiveContao-bundle[Utility &amp; Helpers](/categories/utility)

heimrichhannot/contao-versions
==============================

Create versions within contao with ease and prevent entities from being purged by fromTable name. Also usable in frontend.

2.4.2(1y ago)06.9k12LGPL-3.0-or-laterPHPPHP ^7.4 || ^8.0

Since Aug 24Pushed 1y ago4 watchersCompare

[ Source](https://github.com/heimrichhannot/contao-versions)[ Packagist](https://packagist.org/packages/heimrichhannot/contao-versions)[ Docs](https://github.com/heimrichhannot/contao-versions)[ RSS](/packages/heimrichhannot-contao-versions/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (11)Versions (25)Used By (2)

Versions
========

[](#versions)

This bundle enhances the contao version entity with persistent tables options and helper methods.

Features
--------

[](#features)

- Add fromTable names to `huh_versions.persistent_tables` that should persist within tl\_version forever or a custom time frame.
- Use the VersionModel to find tl\_version models

Register persistent tables
--------------------------

[](#register-persistent-tables)

To make your entities from a given fromTable persist add the table name to the `huh_versions.persistent_tables` within your project configuration (typical `config/config.yml`).

```
# config/config.yml
huh_versions:
  persistent_tables:
    - tl_my_custom_entity
    - tl_keep_forever
```

Create a new version entry
--------------------------

[](#create-a-new-version-entry)

Instead of using the versions class direct, you can use the `VersionControl` service instead.

```
use Contao\FrontendUser;
use Contao\Versions;
use HeimrichHannot\VersionsBundle\Version\VersionControl;

class MyCustomEntity
{
    /** @var VersionControl */
    private $versionControl;

    protected function createVersion(int $id, FrontendUser $member): void
    {
        // Simple call
        $this->versionControl->createVersion('tl_my_custom_entity', $id);

        // Pass additional options
        $this->versionControl->createVersion('tl_my_custom_entity', $id, [
            'hideUser' => false,
            'additionalData' => [
                'memberid' => $member->id,
                'memberusername' => $member->username,
                'username' => 'FrontendUser',
                'userid' => 0,
            ],
            'instance' => new Versions('tl_my_custom_entity', $id),
        ]);
    }
}
```

**VersionControl::createVersion options:**

- *hideUser*: (`bool`) Don't add user to version log entry. Default `false`
- *additionalData*: (`array`|`null`) Pass data that should be stored within the log entry. The array keys must be existing database column names. Default `null`
- *instance*: (`Version`|`null`)Pass a custom `Versions` instance instead of the default one. Default `null`

Configuration reference
-----------------------

[](#configuration-reference)

```
# Default configuration for extension with alias: "huh_versions"
huh_versions:

  # Set table names that should be persist within tl_versions.
  persistent_tables:

    # Examples:
    - tl_content
    - tl_my_custom_entity

  # Set the time period persistent table versions should be kept in version table. Set to 0 for forever.
  persistent_version_period: ~ # Example: 7776000
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance44

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% 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 ~141 days

Recently: every ~331 days

Total

23

Last Release

445d ago

Major Versions

1.0.14 → 2.0.02017-06-20

PHP version history (7 changes)1.0.10PHP ~5.6 || ^7.0

1.0.12PHP ~5.4 || ~7.0

2.0.0PHP &gt;=5.5.0

2.1.0PHP ^5.6 || ^7.0

2.3.0PHP ^7.1

2.4.0PHP ^7.1||^8.0

2.4.2PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/28ad3224d8727b622ebd229840eea6b9dbcb83eb0bd609e6ce65b614830ff538?d=identicon)[digitales@heimrich-hannot.de](/maintainers/digitales@heimrich-hannot.de)

---

Top Contributors

[![koertho](https://avatars.githubusercontent.com/u/12064642?v=4)](https://github.com/koertho "koertho (10 commits)")[![vvohh](https://avatars.githubusercontent.com/u/75325799?v=4)](https://github.com/vvohh "vvohh (1 commits)")

---

Tags

versionscontao

###  Code Quality

Static AnalysisPHPStan, Rector

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/heimrichhannot-contao-versions/health.svg)

```
[![Health](https://phpackages.com/badges/heimrichhannot-contao-versions/health.svg)](https://phpackages.com/packages/heimrichhannot-contao-versions)
```

###  Alternatives

[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[codefog/contao-news_categories

News Categories bundle for Contao Open Source CMS

3183.3k6](/packages/codefog-contao-news-categories)[numero2/contao-storelocator

Contao Plugin for managing stores (or in common address data) and providing a frontend-search based on geo data

121.5k](/packages/numero2-contao-storelocator)

PHPackages © 2026

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