toastnz/duplicator

Silverstripe relationship duplicator

Installs: 6 541

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 5

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

2.0.0 2023-05-18 23:25 UTC

This package is auto-updated.

Last update: 2024-02-19 01:07:02 UTC


README

Simple module to duplicate relationships by hard-copying them when duplicating objects

Requirements

See composer.json

Usage

Define which relationships should be duplicated in the config.yml:

Page:
  duplicator_relations:
    - Slides

Or directly in the class:

<?php

class Page extends SiteTree
{
    private static $many_many = [
        'Slides' => Slide::class
    ];
    
    private static $duplicator_relations = [
        'Slides'
    ];
    
}