src/RecursivePublishable.php
public function rollbackRelations($version)
    {
        $owner = $this->owner;
        // Rollback recursively
        foreach ($owner->findOwned(false) as $object) {
            if ($object->hasExtension(Versioned::class)) {
                // Pass in null to rollback to self version
                /** @var Versioned $object */
                $object->rollbackRecursive(null);
            } else {
                // Rollback unversioned record (inherits parent query parameters)
                $object->rollbackRelations($version);
            }
        }
    }
public function rollbackRelations($version)
    {
        $owner = $this->owner;
        // Rollback recursively
        foreach ($owner->findOwned(false) as $object) {
            if ($object->hasExtension(Versioned::class)) {
                // Pass in null to rollback to self version
                /** @var Versioned $object */
                $object->rollbackRecursive(null);
            } else {
                // Rollback unversioned record (inherits parent query parameters)
                $object->rollbackRelations($version);
            }
        }
    }
public function rollbackRelations ( $ version ) { $ owner = $ this -> owner ; // Rollback recursively foreach ( $ owner -> findOwned ( false ) as $ object ) { if ( $ object -> hasExtension ( Versioned :: class ) ) { // Pass in null to rollback to self version /** @var Versioned $object */ $ object -> rollbackRecursive ( null ) ; } else { // Rollback unversioned record (inherits parent query parameters) $ object -> rollbackRelations ( $ version ) ; } } }
Rollback all related objects on this stage.

Note: This method should be called on the source object queried in the appropriate "from"
for this rollback, as it will rely on the parent object's query parameters to return
nested objects.

@internal Do not call this directly! This should only be invoked by Versioned::rollbackRecursive()
@param int|string $version Parent version / stage to rollback from
Rollback all related objects on this stage .