src/ChangeSetItem.php
public function canRevert($member)
    {
        // No action for unversiond objects so no action to deny
        if (!$this->isVersioned()) {
            return true;
        }

        // Just get the best version as this object may not even exist on either stage anymore.
        /** @var Versioned|DataObject $object */
        $object = $this->getObjectLatestVersion();
        if (!$object) {
            return false;
        }

        // Check change type
        switch ($this->getChangeType()) {
            case static::CHANGE_CREATED: {
                // Revert creation by deleting from stage
                return $object->canDelete($member);
            }
            default: {
                // All other actions are typically editing draft stage
                return $object->canEdit($member);
            }
        }
    }
public function canRevert($member)
    {
        // No action for unversiond objects so no action to deny
        if (!$this->isVersioned()) {
            return true;
        }

        // Just get the best version as this object may not even exist on either stage anymore.
        /** @var Versioned|DataObject $object */
        $object = $this->getObjectLatestVersion();
        if (!$object) {
            return false;
        }

        // Check change type
        switch ($this->getChangeType()) {
            case static::CHANGE_CREATED: {
                // Revert creation by deleting from stage
                return $object->canDelete($member);
            }
            default: {
                // All other actions are typically editing draft stage
                return $object->canEdit($member);
            }
        }
    }
public function canRevert ( $ member ) { // No action for unversiond objects so no action to deny if ( ! $ this -> isVersioned ( ) ) { return true ; } // Just get the best version as this object may not even exist on either stage anymore. /** @var Versioned|DataObject $object */ $ object = $ this -> getObjectLatestVersion ( ) ; if ( ! $ object ) { return false ; } // Check change type switch ( $ this -> getChangeType ( ) ) { case static :: CHANGE_CREATED : { // Revert creation by deleting from stage return $ object -> canDelete ( $ member ) ; } default : { // All other actions are typically editing draft stage return $ object -> canEdit ( $ member ) ; } } }
Check if the BeforeVersion of this changeset can be restored to draft

@param Member $member
@return bool
Check if the BeforeVersion of this changeset can be restored to draft