SilverStripe\UserForms\Extension\UpgradePolymorphicExtension
This extension provides a hook that runs during a dev/build which will check for existing data in various polymorphic relationship fields for userforms models, and ensure that the data is correct.
Various `Parent` relationships in silverstripe/userforms for SilverStripe 3 were mapped directly to UserDefinedForm
instances, and were made polymorphic in SilverStripe 4 (which also requires a class name). This means that a
certain amount of manual checking is required to ensure that upgrades are performed smoothly.
Synopsis
class UpgradePolymorphicExtension
extends DataExtension
{
- // members
- protected array $targets = ;
- protected string $defaultReplacement = UserDefinedForm::class;
- // methods
- public void requireDefaultRecords()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
protected
- $defaultReplacement
—
string
The default class name that will be used to replace values with - $targets
—
array
A list of userforms classes that have had polymorphic relationships added in SilverStripe 4, and the fields on them that are polymorphic