PHPackages                             flxlabs/silverstripe-versionedrelations - 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. flxlabs/silverstripe-versionedrelations

ActiveSilverstripe-module[Database &amp; ORM](/categories/database)

flxlabs/silverstripe-versionedrelations
=======================================

Enable versioning and rollback of many-many relations

0.1.14(7y ago)21.4k1BSD-3-ClausePHP

Since Jan 29Pushed 7y agoCompare

[ Source](https://github.com/flxlabs/silverstripe-versionedrelations)[ Packagist](https://packagist.org/packages/flxlabs/silverstripe-versionedrelations)[ Docs](http://github.com/flxlabs/silverstripe-versionedrelations)[ RSS](/packages/flxlabs-silverstripe-versionedrelations/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (17)Used By (0)

SilverStripe Versioned Relations Module
=======================================

[](#silverstripe-versioned-relations-module)

This module provides the possibility to version silverstripe data object's many-many, has-many and has-one relations.

Usage
-----

[](#usage)

Main class

```
class MyObject extends DataObject {

    private static $extensions = array(
        'Versioned',
        'VersionedRelationsExtension',
    );

    private static $versioned_many_many = array(
        'MMRelations' => 'MyRelatedObjectX',
    );
    private static $versioned_has_many = array(
        'HMRelations' => 'MyRelatedObjectY',
    );
    private static $versioned_has_one = array(
        'HORelation' => 'MyRelatedObjectZ',
    );

    // optionally add extra fields for many-many relations
    private static $many_many_extraFields = array(
        'Relations' => array(
            'MyExtra' => 'Int',
        ),
    );

}
```

MyRelatedObjectX class (many-many)

```
class MyRelatedObjectX extends DataObject {

    private static $extensions = array(
        'Versioned',
        'VersionedRelationsExtension',
    );

    private static $versioned_belongs_many_many = array(
        'MainClasses' => 'MainClass',
    );

    /*
     * NOTE:
     * If you use the betterbuttons module,
     * get rid of the versioning buttons like this:
     */
    public function getBetterButtonsActions() {

        $fieldList = FieldList::create(array(
            BetterButton_SaveAndClose::create(),
            BetterButton_Save::create(),
        ));
        return $fieldList;

    }
}
```

MyRelatedObjectY class (has-many)

```
class MyRelatedObjectY extends DataObject {

    private static $extensions = array(
        'Versioned',
        'VersionedRelationsExtension',
    );

    private static $versioned_belongs_has_many = array(
        'MainClass' => 'MainClass',
    );

}
```

MyRelatedObjectZ class (has-one)

```
class MyRelatedObjectY extends DataObject {

    private static $extensions = array(
        'Versioned',
        'VersionedRelationsExtension',
    );

    private static $versioned_belongs_to = array(
        'MainClass' => 'MainClass',
    );

}
```

Getting the versioned relations:

```
…

$this->getVersionedRelation('Relations');

…
```

TODO
----

[](#todo)

- Check deletion of relations and main classes
- Check Multiple Relations on same class in dot notations
- Add Silverstripe 4 compatibility

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

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 ~36 days

Total

15

Last Release

2888d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1572366?v=4)[Marco Crespi](/maintainers/Valandur)[@Valandur](https://github.com/Valandur)

![](https://www.gravatar.com/avatar/6d287b82e013825e8a9c686abf3df3ad8f649659163a4dc671869b6421fe4721?d=identicon)[FelixEggmann](/maintainers/FelixEggmann)

---

Top Contributors

[![flxqr2](https://avatars.githubusercontent.com/u/25153596?v=4)](https://github.com/flxqr2 "flxqr2 (30 commits)")[![sdfflxlabs](https://avatars.githubusercontent.com/u/25612577?v=4)](https://github.com/sdfflxlabs "sdfflxlabs (3 commits)")

---

Tags

silverstripesilverstripe-datasilverstripe-relationsversionedsilverstripeversioned

### Embed Badge

![Health badge](/badges/flxlabs-silverstripe-versionedrelations/health.svg)

```
[![Health](https://phpackages.com/badges/flxlabs-silverstripe-versionedrelations/health.svg)](https://phpackages.com/packages/flxlabs-silverstripe-versionedrelations)
```

###  Alternatives

[silverstripe/postgresql

SilverStripe now has tentative support for PostgreSQL ('Postgres')

16258.1k2](/packages/silverstripe-postgresql)[brettt89/silverstripe-garbage-collector

SilverStripe Garbage Collector module

109.6k](/packages/brettt89-silverstripe-garbage-collector)

PHPackages © 2026

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