SilverStripe\Versioned\RecursivePublishable::unlinkDisownedRelationship
Unlink an object with a specific named relationship against the owner.
Note: The owner object should be queried in the correct stage / view mode that includes objects that should NOT be unlinked. E.g. if disowning objects from live, the owner object should be queried in draft, and vice versa (or some other source version ID)
Signature
public function unlinkDisownedRelationship(string|int|DataObject
$source,
string
$targetStage,
string
$relationship )
Parameters
$source
— object- Objects in this stage / version / record will not be unlinked.
Provide number if saving records from a version, or string if saving records from a stage $targetStage
— string- Objects which exist in this stage but not $sourceVersion
will be unlinked. This parameter only supports stage name, as you cannot modify specific versions $relationship
— string- Name of has_many relationship to unlink