{"id":37363524,"url":"https://github.com/flxlabs/silverstripe-versionedrelations","last_synced_at":"2026-01-16T04:48:42.224Z","repository":{"id":62505915,"uuid":"80327469","full_name":"flxlabs/silverstripe-versionedrelations","owner":"flxlabs","description":"This module provides the possibility to version a silverstripe data object's many-many relation.","archived":false,"fork":false,"pushed_at":"2018-06-21T14:07:38.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-08T16:13:51.357Z","etag":null,"topics":["silverstripe","silverstripe-data","silverstripe-relations","versioned"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flxlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-29T03:53:53.000Z","updated_at":"2018-06-21T14:07:39.000Z","dependencies_parsed_at":"2022-11-02T12:17:17.069Z","dependency_job_id":null,"html_url":"https://github.com/flxlabs/silverstripe-versionedrelations","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/flxlabs/silverstripe-versionedrelations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flxlabs%2Fsilverstripe-versionedrelations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flxlabs%2Fsilverstripe-versionedrelations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flxlabs%2Fsilverstripe-versionedrelations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flxlabs%2Fsilverstripe-versionedrelations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flxlabs","download_url":"https://codeload.github.com/flxlabs/silverstripe-versionedrelations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flxlabs%2Fsilverstripe-versionedrelations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["silverstripe","silverstripe-data","silverstripe-relations","versioned"],"created_at":"2026-01-16T04:48:42.156Z","updated_at":"2026-01-16T04:48:42.218Z","avatar_url":"https://github.com/flxlabs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SilverStripe Versioned Relations Module\r\n\r\nThis module provides the possibility to version silverstripe data object's many-many, has-many and has-one relations.\r\n\r\n## Usage\r\n\r\nMain class\r\n\r\n```php\r\n\r\nclass MyObject extends DataObject {\r\n\r\n    private static $extensions = array(\r\n        'Versioned',\r\n        'VersionedRelationsExtension',\r\n    );\r\n\r\n    private static $versioned_many_many = array(\r\n        'MMRelations' =\u003e 'MyRelatedObjectX',\r\n    );\r\n    private static $versioned_has_many = array(\r\n        'HMRelations' =\u003e 'MyRelatedObjectY',\r\n    );\r\n    private static $versioned_has_one = array(\r\n        'HORelation' =\u003e 'MyRelatedObjectZ',\r\n    );\r\n\r\n    // optionally add extra fields for many-many relations\r\n    private static $many_many_extraFields = array(\r\n        'Relations' =\u003e array(\r\n            'MyExtra' =\u003e 'Int',\r\n        ),\r\n    );\r\n\r\n}\r\n```\r\n\r\nMyRelatedObjectX class (many-many)\r\n\r\n\r\n```php\r\n\r\nclass MyRelatedObjectX extends DataObject {\r\n\r\n    private static $extensions = array(\r\n        'Versioned',\r\n        'VersionedRelationsExtension',\r\n    );\r\n\r\n    private static $versioned_belongs_many_many = array(\r\n        'MainClasses' =\u003e 'MainClass',\r\n    );\r\n\r\n    /*\r\n     * NOTE:\r\n     * If you use the betterbuttons module,\r\n     * get rid of the versioning buttons like this:\r\n     */\r\n    public function getBetterButtonsActions() {\r\n\r\n        $fieldList = FieldList::create(array(\r\n            BetterButton_SaveAndClose::create(),\r\n            BetterButton_Save::create(),\r\n        ));\r\n        return $fieldList;\r\n\r\n    }\r\n}\r\n```\r\n\r\n\r\nMyRelatedObjectY class (has-many)\r\n\r\n\r\n```php\r\n\r\nclass MyRelatedObjectY extends DataObject {\r\n\r\n    private static $extensions = array(\r\n        'Versioned',\r\n        'VersionedRelationsExtension',\r\n    );\r\n\r\n    private static $versioned_belongs_has_many = array(\r\n        'MainClass' =\u003e 'MainClass',\r\n    );\r\n\r\n}\r\n```\r\n\r\n\r\nMyRelatedObjectZ class (has-one)\r\n\r\n\r\n```php\r\n\r\nclass MyRelatedObjectY extends DataObject {\r\n\r\n    private static $extensions = array(\r\n        'Versioned',\r\n        'VersionedRelationsExtension',\r\n    );\r\n\r\n    private static $versioned_belongs_to = array(\r\n        'MainClass' =\u003e 'MainClass',\r\n    );\r\n\r\n}\r\n```\r\n\r\nGetting the versioned relations:\r\n\r\n```php\r\n\r\n…\r\n\r\n$this-\u003egetVersionedRelation('Relations');\r\n\r\n…\r\n\r\n```\r\n\r\n\r\n\r\n## TODO\r\n\r\n* Check deletion of relations and main classes\r\n* Check Multiple Relations on same class in dot notations\r\n* Add Silverstripe 4 compatibility\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflxlabs%2Fsilverstripe-versionedrelations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflxlabs%2Fsilverstripe-versionedrelations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflxlabs%2Fsilverstripe-versionedrelations/lists"}