public function isArchived()
    {
        /** @var Versioned|DataObject $record */
        $record = $this->record;
        if (!$record->hasExtension(Versioned::class) || !$record->hasStages()) {
            return false;
        }

        if (!isset($record->_cached_isArchived)) {
            $baseClass = $record->baseClass();
            $currentDraft = Versioned::get_by_stage($baseClass, Versioned::DRAFT)->byID($record->ID);
            $currentLive = Versioned::get_by_stage($baseClass, Versioned::LIVE)->byID($record->ID);

            $record->_cached_isArchived = (
                (!$currentDraft || ($currentDraft && $record->Version != $currentDraft->Version))
                && (!$currentLive || ($currentLive && $record->Version != $currentLive->Version))
            );
        }

        return $record->_cached_isArchived;
    }
public function isArchived()
    {
        /** @var Versioned|DataObject $record */
        $record = $this->record;
        if (!$record->hasExtension(Versioned::class) || !$record->hasStages()) {
            return false;
        }

        if (!isset($record->_cached_isArchived)) {
            $baseClass = $record->baseClass();
            $currentDraft = Versioned::get_by_stage($baseClass, Versioned::DRAFT)->byID($record->ID);
            $currentLive = Versioned::get_by_stage($baseClass, Versioned::LIVE)->byID($record->ID);

            $record->_cached_isArchived = (
                (!$currentDraft || ($currentDraft && $record->Version != $currentDraft->Version))
                && (!$currentLive || ($currentLive && $record->Version != $currentLive->Version))
            );
        }

        return $record->_cached_isArchived;
    }
public function isArchived ( ) { /** @var Versioned|DataObject $record */ $ record = $ this -> record ; if ( ! $ record -> hasExtension ( Versioned :: class ) || ! $ record -> hasStages ( ) ) { return false ; } if ( ! isset ( $ record -> _cached_isArchived ) ) { $ baseClass = $ record -> baseClass ( ) ; $ currentDraft = Versioned :: get_by_stage ( $ baseClass , Versioned :: DRAFT ) -> byID ( $ record -> ID ) ; $ currentLive = Versioned :: get_by_stage ( $ baseClass , Versioned :: LIVE ) -> byID ( $ record -> ID ) ; $ record -> _cached_isArchived = ( ( ! $ currentDraft || ( $ currentDraft && $ record -> Version != $ currentDraft -> Version ) ) && ( ! $ currentLive || ( $ currentLive && $ record -> Version != $ currentLive -> Version ) ) ) ; } return $ record -> _cached_isArchived ; }
Counts as "archived" if the current record is a different version from both live and draft.

@return boolean
Counts as archived if the current record is a different version from both live and draft .