toastnz/duplicator

Silverstripe relationship duplicator

Installs: 185

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

1.0 2021-07-22 03:46 UTC

This package is auto-updated.

Last update: 2021-10-22 04:27:13 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'
    ];
    
}